Writes the specified text to the user's terminal and waits for input.
&PROMPT [ NR ]
[ NOPRT ]
[ WAIT=nn ]
{ VARS=prefix* [ RANGE=(start,end) ] |
VARS={ name | (name,name, ..., name) } |
STRING=(name, name, ..., name) |
ARGS [ RANGE=(start,end) ] }
[ INPUT={ CHAR | HEX | HEXEXP } ]
[ AUTONL={ YES | NO } ]
[ prompt ]
&PROMPT is used within an NCL procedure to converse with a user at an LU1 terminal. Having written the supplied text to the terminal, the procedure will be suspended until the user enters some data in reply, or until any supplied time limit expires. Data entered is made available in user variables, as detailed below.
On completion of &PROMPT the system variable &ZVARCNT is set to the number of variables created or modified by the operation.
Operands:
Specifies that no carriage return/line feed function is to be performed following the text. The print head of the terminal will be left at the end of the text. If NR is not specified, the print head will be positioned at the beginning of the next line for subsequent entry of data.
Specifies that the Inhibit Print SCS character is to be sent with the prompt text. For terminals that support this character, the subsequent input will not be printed or displayed at the terminal. The next &WRITE or &PROMPT will automatically re-enable printing.
Specifies that the procedure can wait for nnnn.nn seconds for the user to enter some data (maximum value is 9999.99 seconds). If, after nnnn.nn seconds, no data has been entered, control is returned to the procedure. The &INKEY system variable set to a null value. If data is entered within the time specified, or if no time is specified, &INKEY contains the word ENTER.
Specifies that the input is to be tokenized into the nominated variables before control is returned to the procedure. Each word of the input will be tokenized into the nominated variables from left to right. If insufficient variables are provided, some data will not be available to the procedure. Excess variables will be set to a null value. The formats of the operands that may be coded with VARS are described below.
Denotes that variables are generated automatically during the tokenization process, and that variable names will be 'prefix1,…,prefix2' and so on. The RANGE operand may be specified to indicate a starting and ending suffix number. prefix* cannot be used with other variable names.
The name of a variable, excluding the ampersand (&).
As name, but n denotes the length of the data to be placed in the variable.
Denotes a skip operation, where n represents the number of units to be skipped during the tokenization process. On VARS= statements, n denotes 'skip this number of words'. An asterisk (*) by itself is the same as *(1).
Specifies that no tokenization is to be performed. The entire text of the command line is treated as a single string and returned to the procedure in the nominated variables. The formats of the operands associated with STRING are:
User-specified variables, excluding the leading &, into which the string text is put. Text is placed into each variable up to the maximum length of that variable.
User-specified variables, excluding the leading &, into which the string text is put. Text is placed into each variable for the length specified n.
Denotes a skip operation, where n represents the number of units to be skipped during the tokenization process. On STRING statements, n denotes 'skip this number of characters'. An asterisk (*) by itself is the same as *(1).
Denotes that the input will be tokenized and placed word by word into automatically generated variables of the form &1 through &n, depending on how many are required to hold the text. The RANGE= operand may be coded to designate a start number and optionally an end number, which delimits the number of variables that will be generated.
Specifies the format of the data returned in the variables created by the &PROMPT operation. Default is standard character data. If HEX is specified it means that the data in the variables is pure hexadecimal (and therefore not directly procurable by NCL). HEXEXP means that the data in the variables is hexadecimal data represented as expanded hexadecimal, so that a hexadecimal byte with a value of, for example, 0A will appear in a variable as two characters 0A. HEX and HEXEXP support provide data transparency across &PROMPT operations.
YES specifies that the next output will be preceded by a new line character, if necessary to ensure the output starts in position 1. Specify NO if you do not wish this extra character to be automatically added.
The text of the message to be written. Normal variable substitution is performed before sending the message. Text is in upper and lower case.
Examples: &PROMPT
&PROMPT ARGS Please enter your log on request &PROMPT NR WAIT=900 STRING=(RESPONSE) Enter log on request ===>
Notes:
Any data entered by the user when an &PROMPT statement is not outstanding will be queued pending the next &PROMPT statement, but only up to the 32 KB.
The text of an &PROMPT message can contain non-printable or hexadecimal characters.
Messages written with &PROMPT will not be logged to the activity log. The use of the &WRITE statement should be considered if information is to be written to the log.
The use of the &WRITE LF=NO operand is considered to create 'strike-over masks' on those terminals that do not support the Print Inhibit SCS character.
If the device to which an &PROMPT message is sent responds with a multiple-element chain in reply, &PROMPT completes on the arrival of each chain element. Multiple &PROMPT statements must be issued to receive the entire reply from the terminal. The &ZLU1CHN system variable indicates the position within the current chain of each message received.
Note: See also the sample EASINET procedure $EASINET in the distribution library.
| Copyright © 2009 CA. All rights reserved. |
|