$EXIT (exit)
$EXIT ends processing on an access definition file.
Syntax
$EXIT(return-code)
Values
-
return-code
Specifies a value for the access definition file return code, either as a constant or a variable. The range that can be specified is from 0 to 9.
Remarks
Processing is interrupted if the specified value is out of the range that can be specified for return-code.
Example
The following example outputs the number of asset information data items whose status is active (002) or, if none are found, terminates processing with return code 3:
[CLASS_FIND]
AssetInfo
[FIND_DATA]
(AssetInfo.AssetStatus = '002')AND
(AssetInfo.AssetKind = '001')
[GET_VALUE]
WORK = AssetInfo.AssetNo
[SET_VALUE]
STATUS = $GETSTATUS()
TOTAL = $DATACOUNT()
[IF]
STATUS = NORMAL
[THEN]
[SET_VALUE]
MSG = 'DataCount : ' +TOTAL
$ECHO(MSG)
[ELSE]
[SET_VALUE]
MSG = 'EXIT : 3'
$ECHO(MSG)
$EXIT(3)
[IF_END]- Execution result:
-
EXIT : 3