Equinox Online Help - Language Reference - A to Z

Home

Goto

Applies to
SyntaxGoto LabelName
Action[Statement] Passes control to a block.
ScopeUsable anywhere.
Notes

Control passes to the block specified by LabelName. LabelName is defined in Block statement.

There are restrictions on the use of this statement. If the statement is inside a block, you cannot pass control out of that block. Similarly you cannot pass control into a block. The Goto statement and the block must be at the same structure level. Structure levels are defined by the For, If, While, Repeat, Block, Switch, Procedure and Subtable statements.

CategoryFlow Control
See Also Block_EndBlock, BreakPressed, Continue, Execute, EnableInput, Exit, For...Next, If_Then, Repeat_Until, Return, Sleep, Subtable, Switch, While_EndWhile
Example

This example shows how an insurance claim might be evaluated. Such systems have complicated inter-dependent conditions which must eventually lead to one of several possible actions.

if ClaimType = "HOUSE" then
if TotalInsured < ClaimValue then
Goto HivalueClaim
else
Goto HouseClaim
end if
else if ClaimValue > 5000 then
Goto HivalueClaim
else
Goto DefaultClaimProcedure
end if
block HouseClaim
...

| no more processing For this claim
exit method
end block

block HivalueClaim
...
end block

| "fall through" into the Default Procedure
block DefaultClaimProcedure
...
exit method
end block