A (accept)

<< Click to Display Table of Contents >>

Navigation:  Reference > Commands >

A (accept)

The form of the A (accept) command is:

A variable.text,

A t variable.text,

where variable may be any kind except a wvar. Text may not be more than 60 characters in length.

If this is the first mention of the variable then a letter t (S, M, I, C) denoting the type of variable must precede variable in the command.

Text defined immediately following an A (accept) command will be assigned to the variable referenced in the command, as if it had been defined following a D (define) command.

The A (accept) command is used to read data keyed in at the terminal and to put values in a variable. When an A (accept) command is encountered, the text is displayed at the screen and CL waits for you to enter a value for the variable.

If the variable is an svar or an mvar, then the V (or H or X) text for that variable is also shown at the screen as a menu, each item coded as a letter (A-Z). For this reason, the svar or mvar may not be more than 26 bits in length.

If the variable is an ivar, you must enter an iconstant. If the variable is an svar you must enter one letter from the menu. If variable is an mvar you may enter as many letters as you like from the menu. If the variable is a col, then you must enter one or more codes. If the variable is a field, you must enter a string of characters, the number of characters not exceeding the number of cols in the field. If the number of characters entered is less than the number of cols in the field (including no characters at all), then remaining cols are set blank.

You may enter nothing at all - just hit <RETURN>. If the variable is an ivar or wvar then it is set to U (undefined). But note that if the variable is a cvar, and has not previously been defined, it will retain value 0, not blank.

You may also type ESCAPE, in which case control is transferred to the next CP (checkpoint) command in the CL script. Earlier versions of CL used double quote (") followed by return to escape.

A summary of the number of times each A (accept) command was executed appears in the Report file.

If the Run Control Parameter NODIS is set, A (accept) commands are ignored by the Execution Step.

Examples of A commands:

a i $iage.'How old are you?',

a s $sex.'Enter sex of respondent',

v='male;female', 

a $101-109.'Type acceptable numbers 1-9',

a $mbrand.'Which brands of soap do you use?',