Syntax: Difference between revisions
m (1 revision) |
m (1 revision) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= syntax = | |||
Usage: syntax {''format''} | Usage: syntax {''format''} | ||
Latest revision as of 20:18, 28 January 2009
syntax
Usage: syntax {format}
The statement "syntax" analyzes the command line parameters of the current macro. This statement can only be called within a macro. Command line parameters that match with one of the format specifi- cations are removed from the list of command line parameters and assigned to a new local variable. Possible format items are:
name=[=]type[=default] named parameter with the given name, type, and, optionally, default
name{|name} literal option with the name, or one out of a mutually exclusive list of names
** allows for additional parameters that do not match with one of the formats
* same as "**" except that additional parameters must not contain an "=" sign
A format must not contain blanks. A name may contain a "*" to indicate how much it can be abbreviated. By default, all unambiguous abbreviations are allowed. The optional second "=" sign after a name indicates that a parameter that matches name but doesnt contain an "=" sign is not recognized, otherwise (with one "=" sign after name, an error occurs in this situation). Parameters that appear before "*" or "**" can be specified as positional parameters without giving their name; parameters following "*" or "**" must always be given with their name. A type can be one of the following:
* anything [limit'[=]]@i[[=]limit] integer expression in given range [limit'[=]]@r[[=]limit] real expression in given range name{|name} list of mutually exclusive literals @fextension a filename that will be extended with the given extension, if necessary (extension can also be $name to denote the value of a preceding parameter)