ASK
Jump to navigation
Jump to search
prompts for a keyboard entry of results parameter value
<LABEL> Label of the result parameter to receive answer <PROMPT> A formattable prompt string with optional default in []s. This is used to get input from the keyboard into the results table with an informative prompt string - normally for use in macros. To simply print a message, use the SAY command. The result should be strongly typed using a prefix to the result label name, i.e. F:FREQ or S:NAME (see HELP RESULTS for more result typing info). If it isn't typed then the type of the result will be a string. A special type, Q: is recognized by ASK to treat the input string as if it were enter spaces as well. Prompt strings should be enclosed in double quotes ("") to preserve case and allow spaces in the prompt. The trailing quote may be omitted. If no answer is given, a value surrounded by [] will be used as a default answer. If no answer is given and no default is specified in brackets, ASK will continue prompting until valid input is received. You can override this with the /ONCE switch, which prompts only once and takes whatever input is given. If the user simply hit RETURN and you were using /ONCE, the <label> will contain zero if typed as numeric and the empty string if typed as ASCII. Examples: * A typical call to ASK might have the form: nM> ASK F:FREQ "Input the desired frequency shift in Hz [5.00] :" where if the user presses enter FREQ is assigned the value 5.0 * The command is more attractive when combined with result substitution as follows: nM> ASK F:FREQN "Enter the pass ^NPASS frequency to shift by [^FREQD] :" When executed, the strings preceded by the caret ^ will be interpreted as results parameters, and assuming the parameters NPASS and FREQD are defined as 5 and 5.6420 respectively, the user will see: 'Enter the pass 5 frequency to shift by [5.6420] :' Switches: /ONCE - Ask only one time, even if nothing is entered or defaulted [DEF=FALSE] SEE ALSO: SAY