On...GoTo statement (LotusScript® Language)

Transfers control to one of a list of labels.

Syntax

On numExpr GoTo label [ , label ]...

Elements

numExpr

A numeric expression whose value determines which of the labels is the target of the transfer of control. The value of numExpr must not exceed 255.

label

A label that specifies where control is to be transferred.

Usage

On...GoTo can't be used at the module level or to transfer control into or out of a procedure.

LotusScript® transfers control to the first label if numExpr is 1, to the second label if numExpr is 2, and so on.

LotusScript® rounds numExpr to the nearest integer before using it to determine the target label. If numExpr is 0, or is larger than the number of labels in the list, the On...GoTo statement is ignored and execution continues at the statement following it.

LotusScript® generates an error if numExpr evaluates to a number greater than 255.

Example