Sortwords are variables used within the commands section to pass values between commands. They may be of type word, long, longlong or float. Long longlong and float types must be explicitly declared in this section. Any undeclared variables in the commands section are assumed to be of type word. Sortwords are not limited in scope i.e. they are recognised in the main commands section and all routines.
If a sortword is defined in this section and initialised with a starting value, then the sortword is considered global. This has the effect of keeping its value across events. Sortwords are normally undefined until first use in an event.
Example
WORD COUNTER1=1 COUNTER2=1 FLOAT PI=3.14159declares two 16-bit integer variables COUNTER1 and COUNTER2 both initialised to 1 and one 32-bit floating point variable PI initialised to 3.14159.
Initialisation occurs once at the start of each sort program run.
If a WORD variable is to be output from the commands section using the OUTPUT command then it must be defined with an associated address:
The address is neccessary for word variables to be output in Eurogam format, i.e. a data word with a 14-bit address, so that they can be re-sorted later as pseudo-adc words. The address must lie in the range 0 to 16383 (214-1) and not coincide with any addresses assigned in the *FORMATS section.