===== Macros ===== There are macros in Traffic both in the [[en:traffic:vehicle_list:start|vehicle list]] ([[en:traffic:vehicle_list:vehicle_macro:start|see also there]]) and in [[en:traffic:timetable:start|timetable]]. However, they each have slightly different meanings and are handled even more differently. ==== Usage ==== In the timetable they facilitate z. As the train formation considerably when certain vehicles or vehicle groups are repeated. Whatever can be entered in [[en:traffic:timetable:motion:start|vehicle motion]] after [[en:traffic:timetable:motion:consist:start|C =]] can also be used in a macro. Once a macro has been defined, it can be used as often as required in a timetable, but of course only in lines behind its definition. ==== Definition ==== The definition of a macro is done in one of these ways: $DEF = $DEFINE = $DEFINE_MACRO = In practice, the first, shortest spelling is likely to prevail, but the functioning is the same. Specifically, for example, it would look like this: $DEF V188=DB_V188R|V188~SO Whenever V188 is entered in a vehicle series or another macro, Traffic triggers it to its actual content, ie to one of the two V188ers taken from the vehicle list. If a macro contains a number of vehicles, it can be made independent of the [[en:traffic:timetable:motion:direction|travel]] by inserting either a small or a greater sign after the equation. For example: $DEF DB_624= If only a part of the macro is to be independent of the direction of travel, this is placed in parentheses and the smaller or larger character is included in the parenthesis. $DEF TEE_WR=(ARDUMH105,WRUMH132_TEE)|ARUMZ217BL|ARUMZ217B Macros can, as I said, contain everything that can also contain a row of vehicles in a movement line, be it random vehicle selections, be it vehicle groups, macros or any combinations. You can z. For example, if you combine certain car types in one macro, use this macro in a macro that defines a train, enter the train macro into another macro that contains other similar trainings, and so on. But you can also override macros, giving them new content when the old content is no longer needed in the course of the roadmap - and you can even use macros in yourself. $DEF Schuerzenwagenzug=DRG_AB4U38_2C,(3-5)*DRG_C4U38_2CL|DRG_C4U38_2C $DEF Schuerzenwagenzug=DRG_PW4U37,Schuerzenwagenzug Or also with subsequent directional independence: $DEF Schuerzenwagenzug=DRG_AB4U38_2C,(3-5)*DRG_C4U38_2CL|DRG_C4U38_2C $DEF Schuerzenwagenzug=DRG_PW4U37,(Schuerzenwagenzug) Macros may be defined anywhere on the timetable, but always before they are used. ==== Attention ==== Certain characters should not be used in macro names. Although they may begin with digits and consist entirely of numbers, umlauts are to be avoided as far as possible, for example. ==== Special Uses ==== Macros can not only contain vehicles, but also [[en:traffic:timetable:foreground_background|foreground and background images]] or [[en:traffic:timetable:additional_parameters|additional parameters]]. These can also be nested, so in one macro a foreground sequence can be defined, in a second a background sequence, and a third unites the two into an additional parameter. In macros, even [[en:traffic:timetable:pool|POOLs]] can be entered. However, it must be ensured that movements take place in all registered POOLs. Otherwise, Traffic will give an error message that a POOL was not found. Worth mentioning here is the [[en:traffic:timetable:include_require|integration of external timetables using $INCLUDE or $REQUIRE]]. You can define macros in such timetables, then include these timetables in the timetable that should currently run in traffic, and use the macros as if they were in the current timetable.