G7 Commands: A¶
The commands in the <addfilename> are executed almost as if they were being typed in at the keyboard. G7 knows whether the commands are coming from an add file or not, so sometimes it may behave slightly differently to help speed up the operation. As indicated by the syntax above, the arguments are optional. There may be 99 arguments, and they are passed as text strings. If a long text string with separators such as spaces or arithmetic operators needs to be passed, it should be enclosed in double quotes (“”). The limit of the length of an argument is 90 characters.
Within the add file, the places where the arguments are to be substituted are indicated by “%1” up to “%99”. Strings passed in quotes will be inserted without the quotes.
Add files also may have a group on the command line. A group is a certain way of coding a list of numbers that may represent industries, categories, or other numbers. For example, “1-85” the list of numbers from 1 to 85 inclusive. To use a group as an argument, we must enclose those sectors in parentheses like this:
(1-85)An add command allows its last two arguments to be groups. For example one could write out 85 add commands as follows:
add agr out 1 add agr out 2 ... add agr out 85or equivalently, write them out in only one add command:
add agr out (1-85)Up to two group arguments are allowed. However, group arguments only can be the last ones on the argument list. If two group arguments are used, by default, the outer loop is controlled by the first group argument, and the inner loop by the second group argument. For example,
add invest.reg (32-34) (52-54)is equivalent to:
add invest.reg 32 (52-54) add invest.reg 33 (52-54) add invest.reg 34 (52-54)There is an variation to the double loop, parallel matching, with an ‘m’ option after the second group. For example:
add invest.reg (32-34) (52-55(53)) mis equivalent to:
add invest.reg 32 52 add invest.reg 33 54 add invest.reg 34 55That is, the first members of each group are matched to be the first pair of arguments, the second member of each group to be the second pair, and so on. The two groups must have equal number of members in parallel matching.
Related Topics: Command Files, Groups and Do Lists, catch, do, fadd, function, hesitate, title, #