remainder Full Description |
|
Syntaxremainder shelf-type argument-name (argument-separator)? Purpose A remainder argument is a special kind of argument. It is used to pass a number of discrete values to a function as a single argument. OmniMark does this by "creating" a read-only shelf argument initialized by the values being passed. If a function has a remainder argument, it must be the last argument. In the case that Within the function, the remainder argument behaves exactly as a read-only shelf. The size of the shelf depends on the number of values passed. Remainder arguments cannot be An item on a remainder argument shelf may be passed to a function either individually as a value argument or as part of a remainder shelf argument. The entire remainder argument shelf can be passed as a read-only argument. External functions cannot have remainder arguments. The following sample shows that by using the argument separator before the remainder argument, the separator can act as both the introductory herald for the argument as well as the item separator if the second herald is omitted. To illustrate this point, the second herald for the define counter function sum (value counter x0 , remainder counter xx) as local counter s set s to x0 repeat over xx increment s by xx again return s A call to " set k to sum (1, 2, 3, 4, 5) ; "k" gets the value 15. In this function, the remainder argument is the first (and only) argument. As there is no leading herald, in this case the second herald must be defined. |