Indicates if a value is an error condition.
Syntax
@IsError(value:any) : int
Parameter |
Description |
value |
The name of the value to be checked. |
Return value |
Description |
int |
1 if the value is an error condition; otherwise
0. See @Error (JavaScript) for
generating an error condition. |
Usage
This function also returns 1 if the value
is undefined or NaN.
Examples
This example contains a function that
returns
@Error()
in certain cases. The top-level
function tests for
@Error()
.
function getfield(fieldname) {
var n = @GetField(fieldname);
@Return(@If(n < 0, @Error(), n > 255, @Error(), n));
}
@If(@IsError(getfield("//field3")),
"Out of range",
// else
getfield("//field3"));