Version 1.5 2016-07-14
A Driver schedule command to create or change the value of a session variable using a new format.
The command is structured by selecting the required menu entries: first the variable name then the assignment.
Add the InputTable rule to your session and then add new entries with the following format:
For variable names use: svname,variable-name
For assignments use: svar,assignment,value
All terms are separated by commas.
Advanced usage: value can be the name of another variable which contains a number.
If the defined svname starts with a $ symbol then the variable is stored as an alphabetic string.
Valid assignments are: set, inc, dec, ran,
where
set means set variable to value
inc means increase variable by value
dec means decrease variable by value
ran means set variable to a random number between 1 and value
Example Meaning
svname, XYZ Define variable name 'XYZ'
svname,My Variable Define variable name 'My Variable'
svname,$My Name Define a variable to hold a string of letters
svar,set,2 Set variable value to 2
svar,inc,3 Increase variable value by 3
svar,dec,5 Decrease variable value by 5
svar,ran,6 Set variable to a random number 1-6
svar,set,XYZ Set variable to the value of 'XYZ'
svar,set,'Fred' Set variable to an alpha string 'Fred'
Do not use floating point (decimal) numbers.
Once a set of command entries is added to the InputTable rule, they will appear in the Set S-Variables command menu.
Examples of completed driver orders:
Set XYZ to 2
Inc My Variable by 3
Dec XYZ by 5
Set My Variable to XYZ
Set $My Name to 'Fred'
Thanks to Atila Barut for the original framework and to Lots_Trains for beta testing.