A sequence of words enclosed in curly braces is recognized by the device driver as an RPN command sequence. Within the RPN sequence commands must be separated by whitespace. Each word is interpreted as one of the following:
| Variable names | cause the interpreter to push the variable's contents onto the stack. |
| Table names | cause the interpreter to remember this translation table and use it for the next rxlt / xlt command(s). |
| Numeric (decimal) constants | are pushed onto the stack as double precision floating point values. |
| Character strings (in double quotes) | are pushed as they are. |
| Commands / keywords | are executed as the RPN command reference in the following chapter describes. |
Example
{
"ENQ;AUN" prt // request the number of
inp "=" find // audio streams, get the reply
!internal.numAudio // and store it
internal.numAudio if
"" // audio stream list
0 // loop counter
do
"ENQ;AUX=" over "d04" fmt strcat prt // request one entry
swap // get the list on top
inp "=" find // the complete entry
dup "," trm 2 substr // entry number 2 digits
" " strcat // delimiter
swap "," find "," find // language description
strcat strcat "\n" strcat // append the reply
swap // loop counter on top
1 + // increment it
internal.numAudio 1 - // decrement numAudio,
!internal.numAudio // loop until there are more
internal.numAudio while // audio streams
drop // the loop counter
else
"NONE\n"
endif
!audioList
clr // due to paranoia ;-)
}
The example above - taken from the Tandberg-Alteia device driver - fills the variable audioList with a newline separated list of available audio streams as reported by the IRD. The RPN sequence first gets the number of available streams from the IRD and stores this into internal.numAudio, Then, unless internal.numAudio is zero, the program builds the list from the information returned by the IRD for each stream.