Valid
(Engine-Level Function)
| Description | Returns true if the parameter is any value other than Invalid. |
| Returns | Boolean |
| Usage | Script or steady state. |
| Function Groups | Variable |
| Related to: | Invalid |
Format: ![]() |
Valid(X) |
| Parameters: |
| X |
| Required. Any expression to be tested for validity. |
| Comments | This function always returns a valid value. |
Examples:
A = Valid(1.23);
B = Valid("Help");
C = Valid(Invalid);
D = Valid(12.3 / 0);
The values for A, B, C and D will be 1, 1, 0 and 0 respectively.
A common use for this function is as an action trigger to prevent "if 1" conditions:
If !Valid(StartTime);
[
StartTime = Seconds();
]
This will cause the script to execute once and once only. StartTime will be set to the time (in seconds since midnight) that the script was executed.
