Showing changes from revision #3 to #4:
Added | Removed | Changed
The syntax string is made up of one or more keywords separated by commas. Each keyword consists of an identifier, an optional alias and a qualifier which specifies how the keyword and parameter are to be interpreted in the input string. As both identifier and qualifier are optional, "" is a valid keyword.
String= | keyword[, keyword] |
Keyword= | [identifier [=alias] ] [/qualifier] |
Qualifier | Meaning |
---|---|
A | Keyword must always be given value |
K | Identifier (or alias) must be used. Ignored if /S used |
S | Identifier is a switch, the value stored will be the presence or absence of the switch |
E | Call OS_EvaluateExpression on parameter in the input string |
G | Call OS_GSTrans on parameter in the input string |
An identifier can be any string composed of alphanumerics and the “_” character. Case is ignored.
The alias is an optional alternative name for the same keyword. You do not need to specify the first letter of the identifier as an alias.
If /K is specified as a qualifier for a keyword then an identifier or alias must also be specified.
Every other qualifier may be used without an identifier, and more than one qualifier may be specified for a keyword though /S, /E and /G are mutually exclusive.
The /E qualifier whilst intended for converting numbers can also return strings. For example 1+7
will return the number 8, whereas 1234 LEFT 2
will return the string "12"
.
The /G qualifier is recommended for parameters that are expecting a filename or directory path as any system variables and pathnames will get expanded for you. you, though not paths (UseOS_FSControl 37 to convert paths).
The position of each keyword in the syntax string determines the position in the output buffer where the parameter value associated with that keyword will be stored regardless of where it is in the input string.
It is recommended to use identifiers where possible as this allows users to specify the parameters for your program in any order.
When used in a BASIC program you must take into consideration that the command line will have "BASIC -quit"
added to the start. For example typing MyProgram
at the command line, the command line will become: BASIC -quit "MyProgram"
. See the examples page for further details.