EndExit

Syntax

END | ENDEXIT | ENDNOPRINT

Parameters

EndExit can be abbreviated as EE.

The EndExit logic command is preceded by a loop or condition logic statement.

Description

The EndExit logic command functions similarly to the End logic command in that it specifies the end of a sequence of logic statements introduced by a loop command (Loop, LookUp, and looping LookUp and Determine logic command variants) or a condition command (DoWhen and Match logic commands). However, when an EndExit logic statement terminates a loop, only one pass is made through the loop. The remaining logic is also skipped, effectively terminating Prepare, Construct, or Main method calls in ispecs, or Main method calls in reports. EndExit terminates processing in any method. However, there might be many cases where only the logic of the called method is to be terminated in which case executing a Return command is more appropriate.

In frame methods, the EndExit logic command terminates the method, the frame is printed, and execution continues after the Print method call that invoked the frame.

In Prepare methods, the EndExit logic command terminates the method, and execution continues with the Main method unless the Glb.Error built-in segment attribute is set to "*****".

Including an EndExit logic statement in the logic of an insertable class or segment method has the same result as if the EndExit logic statement were included directly in the logic.

The EndExit logic command does not set the Glb.Error built-in segment attribute and does not inhibit database updates.

Note: An EndExit logic statement following an Else logic statement applies only to the Else logic statement, rather than the associated DoWhen logic statement.

Refer to EndExit and EndNoPrint for more information on other loop termination logic commands.

Copy Ispecs and Copy Events

In copy ispecs and copy events, the EndExit logic command stops execution of the current method (Construct, Prepare, Edit, or Main) but has no effect on the execution of subsequent copies.

In Construct methods, the EndExit logic command stops execution of the current copy but it has no effect on the execution of subsequent copies.

In Prepare methods, if the Glb.Error built-in segment attribute is set to "*****", the EndExit logic command stops execution of the current copy but it has no effect on the execution of subsequent copies. If Glb.Error is not set, the EndExit logic command skips execution to the next method (automatic validation) of the current copy.

In Edit methods, during the validate phase of the copy cycle, the EndExit logic command stops execution of the current copy but subsequent copies are validated. During the update phase, the EndExit logic command skips execution to the Main method of this copy, and Glb.Error is set to the value of the Glb.Spaces built-in segment attribute.

In Main methods, if the Glb.Error built-in segment attribute is set to "*****", the EndExit logic command stops execution of the current copy but it has no effect on the execution of subsequent copies. If the Glb.Error built-in segment attribute is not set, the EndExit logic command skips execution to the next method (automatic update) of the current copy.

Example

If (SDTotal > Debt.CredLimit && Override <> "OK")
      Message Error "Customer has exceeded credit limit"
EndExit