JTraffic Screensaver

$DEF, $DEFINE, $DEFINE_MACRO

$DEF <Name> = <Text>\
$DEFINE\
$DEFINE_MACRO

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:

$DEF BR218=BR218BB|BR218ROT

$DEF DIESEL_FUER_PERSONENZUG=3:BR218|BR211

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:

$DEF GS=G_GGS|SNCF_GS41A

C=DR_106,3*GS;

$DEF GS=SNCF_GS311A|SNCF_GS41A

C=DR_106,3*GS;

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:

$DEF GS=G_GGS|SNCF_GS41A

and you write after the $INCLUDE command:

$DEF GS=SNCF_GS311A|GS

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

$DEF VRCONT9=VR_LGJN[O:2CONT80,13,13]

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

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