[Next] [Up] [Previous]

The QUERY Statement

The QUERY statement
(ACCEPT)

The QUERY statement has the form:

       QUERY device;item:name:name...,item:name:name...,...

and allows user input to modify the variables named in it as follows:

       QUERY X,Y,Z

prompts the user for a line of input. If that line were

X=2.5,Y=7.5

then X would be given the value 2.5, Y the value 7.5, and Z would be unaffected. (Since X, Y, and Z appear in a QUERY statement, this signals the compiler to remember their printed names, which are otherwise discarded in compilation.)

If the name parameter is specified, then an alternate variable name can be used in input; for example,

       QUERY T1:'TEMP':'TEMPERATURE',V1:'VELOCITY'

allows T1 to be also called TEMP or TEMPERATURE. Thus, name can be any character expression.

QUERY variable name input is case-insensitive, following the rule in effect when the QUERY statement was compiled.

Note that QUERY performs the function of FORTRAN NAMELIST input, but without the need to list the names used separately; it is similar to the GET DATA statement in PL/I, or the ACCEPT statement in some dialects of FORTRAN IV.

The commas separate successive arguments of the same type, and thus have no &'...' substitutes or recommended @-comments. The colons, however, can be noted as variable @AS: name @OR: name with AND a possible alternative for OR in @-comments; @AS: can also be &'AS' but subsequent colons have no &'...' substitute.


[Next] [Up] [Previous]