JTraffic Screensaver


$DEF <Name> = <Text>\

Defines a macro.

Macros can be a vehicle, a part of a train or even an entire train.  They are useful when there is something that must be used or performed multiple times.  Macros can also be nested within other macros.  For example:



The same macro name can be "recycled" - that is, defined more than once in the Timetable File.  However, the macros are read in reverse order from the end to the beginning (from the last macro defined to the first macro defined).  

All of the macro definitions will be stored into memory first, and the movements will be evaluated after that.  For example:





is a useless double definition: Though it would appear that the second macro redefines the term GS, in fact, after defining all of the macros, GS will have the second value, either a French Gs41 class or a French Gs311 class freight wagon, not a Ggs and a Gs41.

The reason for the redefinition is to extend the meaning of a macro - or a simple vehicle name. Its intended position should be after an $INCLUDE command, or to define some properties for a vehicle, if these are not stored in the stock list.

If the following definition is inside an included file:


and you write after the $INCLUDE command:


then the name GS will be a choice from all three freight car types.

In the case of nested macros, the individual macros will be read from the position of the expanded macro backwards.  This strategy allows one to redefine a macro or a picture name many times.  The intended usage for this feature is to append modifiers to the pictures (if this wasn't done in the Stock List) or to change the behaviour of some vehicles.

Macros can call other macros, but the macros being called must appear before the macro(s) which call them.  For example:

$DEF 2CONT80=C2R17|C2R_ITEL|C2R_YHL|C2050|C2006|C2_TRITON|C2054


In this example, the macro defined as 2CONT80 must appear in the Timetable before the macro VRCONT9 because VRCONT9 requires 2CONT80 to function.

The Configuration Window
Program Window
Stock List
Description Editor
Graphic Testpad
Timetable Editor
Timetable Syntax and Semanics
The timetable header
Sections, Groups, Lines, Scenes
Stock List File