RpcExcept  Y5KPXR

The RpcExcept function specifies exception handling.

RpcTryExcept
   
   
guarded statements
    }
RpcExcept(
expression)
   
   
exception statements
   
}
RpcEndExcept;

Parameters

guarded statements

Specifies program statements that are guarded or monitored for exceptions during execution.

expression

Specifies an expression that is evaluated when an exception occurs. If expression evaluates to a non-zero value, the exception statements are executed. If expression evaluates to a zero value, unwinding continues to the next RpcTryExcept or RpcTryFinally routine.

exception statements

Specifies statements that are executed when the expression evaluates to a non-zero value.

 

Remarks

If an exception does not occur, the expression and exception statements are skipped and execution continues at the statement following the RpcEndExcept keyword.

RpcExceptionCode can be used in both expression and exception statements to determine which exception occurred.

The following restrictions apply.

    Jumping (via a goto) into guarded statements is not allowed.

    Jumping (via a goto) into exception statements is not allowed.

    Returning or jumping (via a goto) from guarded statements is not allowed.

    Returning or jumping (via a goto) from exception statements is not allowed.

 

See Also

RpcExceptionCode, RpcFinally, RpcRaiseException