h6. [[OS SWI Calls]] h6(. » OS_ReadArgs h2. OS_ReadArgs h5. (SWI &49) |_<^{width:4em}. Entry | | |<^. R0 |<^. Pointer to [[OS_ReadArgs Syntax String|syntax string]] | |<^. R1 |<^. Pointer to [[OS_ReadArgs Input String|input string]] | |<^. R2 |<^. Pointer to [[OS_ReadArgs Output Buffer|output buffer]] | |<^. R3 |<^. Size of output buffer | |_<^{width:4em}. Exit | | |<^. R0 |<^. Preserved | |<^. R1 |<^. Preserved | |<^. R2 |<^. Preserved | |<^. R3 |<^. Bytes left in [[OS_ReadArgs Output Buffer|output buffer]] | h4. Use The purpose of this call is to scan the input string, and places values in output buffer according to the syntax string. It is generally used to extract parameters from the command line following a call to [[OS_GetEnv]] and using the value of R0 as the input string. As such this call should be used at the start of a program before the first [[Wimp_Poll]]. This call will return error 490 "Parameters not recognised" if: * the input string has a keyword that is not specified in the syntax string * the syntax string has a keyword with qualifier "/A" that is not in the input string * the input string has items which have not been matched to the syntax string This call will return error 491 "Argument repeated" if a parameter is repeated in the input string. This call will also call [[OS_EvaluateExpression]] and [[OS_GSTrans]] if the qualifiers "/E" and "/G", respectively, are specified in the syntax string, and any errors from them will also be returned. In the event of an error, this call does not give any indication as to which item in the input string has caused the problem. h4. See also * [[OS_ReadArgs Input String]] * [[OS_ReadArgs Output Buffer]] * [[OS_ReadArgs Syntax String]] * [[OS_ReadArgs Examples Page]]