Syntax
ACCEPT object_name
Parameters
Accept can be abbreviated as AX.
object_name
The variable receiving input.
Description
The Accept logic command passes information to a running report from its initiating terminal.
When an Accept logic statement is encountered, the report suspends execution until it receives a reply from the terminal. It is generally preceded by an associated Message logic statement that prompts for input. Any input received is passed to the specified variable.
Note: The Accept logic command is for use in Reports only. The use of this command in Ispecs and Messengers is invalid or is ignored.
Data truncation
The following data truncation issues apply to use of the Accept logic command:
If the input value is shorter than the specified variable, it is right-padded with zeros. For example, an input value of 10 to a number-primitive of length 5 becomes 10000.
If the input value is longer than the specified variable, it is truncated.
If a national string value is input to a national string-primitive variable, the value is moved character-by-character, and truncated to the length of the variable.
If a national string value is input to a string-primitive variable, the value is moved byte-by-byte, and truncated to the length of the variable. This truncation might occur after the first byte of a double-byte character, resulting in an invalid character.
Restrictions
The following restrictions apply to use of the Accept logic command:
Signed numeric input cannot be passed to unsigned attributes. If signed numeric data is passed, the sign is lost.
Non-numeric characters cannot be passed to number-primitive variables. If a non-numeric character is passed, the variable is set to 0 (zero).
Separator characters cannot be passed to number-primitive variables. However, number-primitive variables are able to accept sign and decimal point characters.
When passing a value to a number attribute with decimals include a decimal character. For example, to pass a value of 10 to an attribute defined with two decimal places, enter 10.00 instead of 1000. If a decimal character is not included, the result might not be as expected.
Examples
Example 1
This example continuously prompts for the RunDate report date until it is successfully validated.
Loop Message Attention "Enter the report date DDMMYY" Accept RunDate DateConvert RunDate Format DDMMYY EditOnly If Glb.Status <> "*****" Break End End
Example 2
This example prompts for the RunQty quantity, and interprets it as a number value with two decimal places. For example, an input of 12345 leaves RunQty with the value 123.45, and an input of 00763 leaves RunQty with the value 7.63.
Message Attention "Enter value with 2 implied decimals" Accept RunQty