INQUIRE @name
The INQUIRE command is similar to the DEFINE command in that it creates a
symbol. However, it prompts the user for the definition of the symbol.
INQUIRE is most often used by procedures to prompt for the values of parameters when the procedures are executed.
The query character (`?') can also be used to prompt the user. The difference is that INQUIRE defines a symbol, which may then be referenced for the rest of the session, or until it is redefined or removed. A query character indicates that a one-time substitution is to be made. The difference is illustrated by the example below.
Consider the following procedure, in which the INQUIRE command is used to
define two symbols, TARGET and OUTPUT.
INQUIRE TARGET; INQUIRE OUTPUT; FIND CLEAR SEPARATION OF TARGET JUPITER FROM EARTH GREATER THAN 0 STEP SIZE STEPSIZE?; FIND DARK ECLIPSE OF TARGET BY JUPITER FROM EARTH STEP SIZE STEPSIZE?; LET OUTPUT = CLEAR - DARKWhen the procedure is executed, the user must supply definitions for the symbols.
Enter definition for TARGET > EUROPA; Enter definition for OUTPUT > EUROPA_VISIBLE; Enter value for STEPSIZE > 2 hours; Enter value for STEPSIZE > 2 hours;(Note that a definition, like a normal statement, must be terminated with a semicolon.)
The value for TARGET and OUTPUT are supplied once, but the value for STEPSIZE must be provided each time the query STEPSIZE? is encountered.
Contrast this with the following procedure, which uses queries.
FIND CLEAR SEPARATION OF TARGET? JUPITER FROM EARTH GREATER THAN 0 STEP SIZE 1 HOUR; FIND DARK ECLIPSE OF TARGET? BY JUPITER FROM EARTH STEP SIZE 1 HOUR; LET OUTPUT? = CLEAR - DARK;When the procedure is executed, the user must supply values for the queries.
Enter value for TARGET > EUROPA; Enter value for TARGET > EUROPA; Enter value for OUTPUT > EUROPA_VISIBLE;Once INQUIRE has been used to define a symbol, the symbol can be used repeatedly. A query exists only until a replacement value has been specified.
The UNDEFINE command removes symbol definitions.
The current symbols and their definitions can be examined with the SHOW SYMBOL command.