CHECKVALID function

Synopsis
This function returns the specified value if possible, otherwise it returns a default value. This function can be used to provide an alternate value should a requested value not be available. This will prevent the project from being stopped when attempting to use an invalid value.
Remarks
Variations
CHECKVALID(Value, DefaultValue)
Returns a specified value if possible.
Parameters
Value

Specifies the value to attempt to return.

Supported types: Numeric; Boolean; String; Object; Point.
DefaultValue

Specifies the value to return should Value not be returnable. The default value should be the same data type as Value.

Supported types: Numeric; Boolean; String; Object; Point.
Returns
Returned types: Numeric; Boolean; String; Object; Point.
Examples
1.

The following example returns an object X of the 10th occurrence if at lest 10 occurrences were found. Otherwise returns 0.

CHECKVALID( ModelFinder.Occurrences(10).X, 0 )