Previous Topic: &$CROPT=INIT Statement

Next Topic: Table Entry Validation Exit Procedure Interface


&$CROPT=TERM Statement

This statement indicates one of the following occurred from a run-time criteria panel:

This call is not applicable if there is no run-time criteria panel. When the value of &$CROPT is TERM, you can use the criteria exit procedure to perform any special processing on the run-time criteria.

Read-Only Variables

This statement contains the following read-only variables:

&$CROPT

This variable is set to TERM.

&$CRAPPLID

This variable is set to the ID of the application to which the criteria set belongs.

&$CRCRITTYPE

This variable is set to one of the following types:

PUBLIC

The criteria set is public.

PRIVATE

The criteria set is private.

&$CRCRITUSER

If the criteria set is private, this variable is set to the ID of the user to whom the criteria belongs. If the criteria set is public, this variable is not set.

&$CRCRITNAME

This variable is set to the name of the criteria.

&$CRDESC

This variable is set to the description of the criteria.

&$CRPANEL

This variable is set to the name of the run-time panel defined for the criteria.

&$CRDATASRC

This variable is set to the data source defined for the criteria.

&$CREPARMTOT

This variable is set to the number of exit parameter lines defined for the criteria in the range 0 through 9999.

&$CREPARMn

This range of variables are set to the exit parameters defined for the criteria if &$CREPARMTOT is greater than zero; n is in the range 1 to the value of &$CREPARMTOT.

&$CRCURSOR

This variable is set to the current cursor position if a run-time panel is defined for the criteria. If a run-time panel is defined, this variable must be specified on the CURSOR parameter of the #OPT statement in the panel definition.

&$CRCOMMAND

This variable is set to the command executed from the run-time panel. The value is null if the Enter key was pressed and no command was entered. This variable must be used as the input field for the Command field on the run-time panel. This variable, when set, contains one of the following commands:

ACTION

The ACTION command was executed to allow the specification of variable data from the run-time panel to be included in the criteria.

EXIT

The EXIT command was executed to terminate the run-time panel.

Modifiable Variables

This statement contains the following modifiable variables:

&$CRALARM

Use this variable to control the terminal alarm if a run-time panel is defined for the criteria. Valid values are YES to turn the alarm on and NO otherwise. This variable must be specified in the ALARM parameter of the #ERR statement in the panel definition.

&$CRERRFLDS

Use this variable to return the names of the input fields that contain incorrect values to the system. This variable can be set to the input fields that are in error in the form fieldname1, fieldname2...fieldnameN.

&SYSMSG

Use this variable to return a message. If an error occurs during special processing, this variable must be set to an error message.

Return Codes

The variable &RETCODE must be set by the criteria exit procedure to one of the following return codes:

0

Continue processing

4

Redisplay the run-time panel (not valid if &$CRCOMMAND is set to EXIT)

8

An error occurred; terminate building the criteria