Accept

Syntax

ACCEPT object_name

Parameters

Accept can be abbreviated as AX.

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 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:

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