property Argument [aInx : Integer] : Integer
Returns the arguments for the current command.
Please see the Argument property of the TApxTerminalParser class on page 192 for a description of how the Argument property works.
Some VT100 escape sequences use default values for certain arguments. For example, the Cursor Right sequence is <Esc>[C, but it is also possible to specify the number of character positions to move. In our case, the sequence would be <Esc>[2C for two positions. The VT100 parser in TApxVT100Parser would create a single argument of 1 (the default) for the first case, and a single argument of 2 (an explicit argument) for the second case. There is no way to find out if the parser has created an implicit default argument or used an explicit argument, unless you wish to parse the Sequence property yourself. In general, this would not matter: the value of an argument is all you need to process the command properly.
In certain cases, the parser will be unable to determine the value of the default argument since it would depend on information it does not have. An example for this is the Set Scrolling Region command. This command has two arguments: the top row and the bottom row of the scrolling region. The defaults are the top row and the bottom row of the screen itself, neither of which are known by the parser. If the parser is unable to work out what the default value of an argument is, it will set the relevant element of the Argument array property to –1, meaning default.
There is a set of VT100 escape sequences that use the '?' character in the parameter part of the sequence. An example is <Esc>[?3h to set the VT100 terminal into 132-column mode. The parser in the TApxVT100Parser class parses this escape sequence as having two arguments, the '?' and the '3'. Since the Argument property only returns integers, the '?' character must be replaced by a special integer value, in this case, –2. Hence, in our example, the command would have two arguments: –2 and 3. (The reason for this slightly eccentric behavior, versus just ignoring the '?' character altogether, is that '?' signifies a DEC extension rather than just a straightforward ANSI escape sequence. The parser needs to return this information as well.)