Gri Commands
|
12.30: The `
|
`query \synonym|.variable. \ ["\prompt" [("\default"|.default)]]' |
Ask the user for the value of a variable (number) or synonym (text string). Gri recognizes the type of the item being asked for, either a variable or synonym, by the presence of a dot or backslash in the second word of the command line. If a prompt string is given (in quotes), then this string is shown to the user. If a default is given (in parentheses), then it will be displayed also, and if the user types carriage-return, then that item will be assigned to the variable or synonym. If the default has more than one item, then Gri considers this a restrictive list of possibilities, and will demand that the answer be in that list, going into an infinite query loop until an item from the list (or carriage-return, meaning take first item) is found. The items in the list are to be separated by spaces, not commas or any other non-whitespace characters.
NOTE: The `-y
' command-line option bypasses all query commands,
fooling Gri into thinking that the user typed a carriage-return to all
questions. Thus the defaults, if they exist, are selected.