$SETOPTION (set run options)
$SETOPTION sets options so that script processing will not be interrupted even if an error occurs on the script.
Syntax
$SETOPTION('option-name',parameter)
Values
-
option-name
Specifies the following option (you can specify one option per function):
-
ErrorFlush
Specifies whether or not script processing is to be interrupted when an error occurs in a script.
-
-
parameter
The following parameters can be specified with the ErrorFlush option:
-
0
Terminates script processing if an error occurs.
-
1
Continues script processing even if an error occurs.
-
Status
The following table lists and describes the possible statuses:
|
Status |
Description |
|---|---|
|
NORMAL |
Normal end |
|
ERROR |
An invalid value was specified for parameter. |
|
FLUSH |
Error occurred, but processing continued (when 1 is specified in parameter). |
|
Script execution interrupted |
Indicates one of the following:
|
Example
If asset number 1000000001 is already in use, this example outputs the contents of MSG to the log file without terminating the script:
[SET_VALUE]
$SETOPTION('ErrorFlush', 1)
[APPEND]
AssetInfo
[DATA]
AssetInfo.AssetID = 1000000001
AssetInfo.AssetNo = 1000000001
[SET_VALUE]
$LOGMSG('E', MSG)