Showing changes from revision #3 to #4:
Added | Removed | Changed
Entry | |
---|---|
R0 | Pointer to argument list |
R1 | Pointer to buffer for resulting string |
R2 | Length of buffer |
R3 | Pointer to template string |
R4 | Length of template string |
R5 | Flag bit in bit 31, (bits 0-30 reserved) |
Exit | |
---|---|
R0 | Preserved |
R1 | Preserved |
R2 | Length of result string (including terminator) |
R3 | Preserved |
R4 | Preserved |
R5 | Preserved |
The purpose of this call is to substitute command line arguments
This call performs the hard work involved in substituting a list of arguments into a ‘template’ string. Its main use is in the processing of command Alias$...
variables by the system. It’s also useful in other situations; it has been made available to users. For example, FileSwitch uses it in the processing of Alias$LoadType_TTT
variables.
The argument list is a string consisting of space separated items which will be substituted into the template string. Spaces within double quotation marks are not counted as argument seperators. Typically, the argument string will just be the tail of a *Command. Its control character terminated. The result of substituting the arguments into the template string is placed in the buffer. The length of the buffer is given so that the call can check for buffer overflow. The template string is copied into the result buffer char for char. However, when a ‘%’ appears in the template string (even within quotation marks), it marks where an argument should be placed into the output buffer. The ‘%’ is followed by a single digit from 0 – 9. 0 stands for the first argument in the argument list and so on. % means a single . Anything else following the ’’ is not treated specially, i.e. both the % and the character are copied over. The template string doesn’t have a terminator; instead its length is given. At the end of substitution, any arguments after the highest one mentioned in the template string are appended to the result string. To prevent this set the top bit of R5 on entry. If a non-existing argument is specified in the template string, then a null string is substituted, no error is given.
The CallASWI module (version 0.03) allows this SWI to be used with RISC OS pre 5.00.