Throw Statement (FPScript)

09.03.2021

Throws an exception and returns the specified expression as the value of the exception.

Syntax

Throw [Value]

The syntax of the Throw statement consists of the following elements:

Element

Description

Value

An optional expression to be used as the value of the exception. If you leave out the expression, the exception has the data type Empty.

Remarks

The exception can be caught and processed using a Try statement. If the exception is not caught, an error message is generated containing the value of the exception.

Available in

FlexPro View, Basic, Professional, Developer Suite

Example

Carries out a division calculation and throws an exception if the divisor equals zero.

Arguments X, Y

If Y == 0 Then

    Throw "Division by zero detected!"

End

X / Y

See Also

Try...Catch Statement

Return Statement

Share article or send as email:

You might be interested in these articles