PROMPT program instruction PROMPT program instruction Syntax PROMPT output_string , variable_list Function Display a string on the system terminal and wait for operator input. Parameters output_string Optional string expression that is output to the system terminal. The cursor is left at the end of the string. variable_list A list of real-valued variables, or a single string variable, that receives the data. Details Displays the text of the output string on the system terminal, and waits for you to type in a line terminated by pressing the RETURN key. The input line can be processed in either of two ways: 1.
If a list of real-valued variables is specified as the variable list, the line is assumed to contain a list of numbers separated by space characters and/or commas. Each number is converted from text to its internal representation, and its value is stored in the next variable contained in the variable list. If more values are read than the number of variables specified, the extra values are ignored. If fewer values are read, the remaining variables are set to zero. If data is read that is not a number, an error occurs and program execution stops. Each PROMPT instruction should request only one value to avoid confusion and to reduce the possibility of error. 2.
If a single string variable is specified as the variable list, the entire input line is stored in the string variable. The program must then process the string appropriately. If you press the RETURN key, or press CTRL+C, an empty line is read. This results in all the real variables being set to zero, or the string variable being assigned an empty string. If you press CTRL+Z, an end-of-file error condition results. If there is no REACTE instruction active, program execution is terminated and an error message is displayed. Thus, CTRL+Z can be a useful way to abort program execution at a PROMPT. Examples Consider the instruction: eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 414