Previous Topic: &END

Next Topic: &EVENT


&ENDAFTER

&ENDAFTER terminates the current nesting level after executing the command following &ENDAFTER.

&ENDAFTER { command | statement }

&ENDAFTER is used to simplify procedure coding. Many procedures perform one command per operator entry, or similar. Each command might then require an &END statement, or an &IF must issue an &GOTO to branch to a point to perform a single function.

&ENDAFTER lets you execute a single command in conjunction with an &IF statement (if required), followed by automatic termination of the current nesting level.

This allows &GOTO statements to be eliminated from a procedure.

Operands:

command | statement

Specifies the text of the command or statement to be executed. Processing of the current nesting level finishes after this command or statement is executed.

Examples: &ENDAFTER

&IF .&OPTION = .  &THEN +
   &ENDAFTER -EXEC DFLTPROF
&IF .&OPTION = .TAPE &THEN +
   &ENDAFTER -EXEC TAPEPROF
&ENDAFTER -PROFILE ENV=PRIMARY UNSOL=NO

Notes:

If an EXEC of another procedure or nesting level is performed as the function of an &ENDAFTER statement, the new nesting level is executed before processing at the current nesting level is completed.

The following verbs are illegal on an &ENDAFTER statement:

&DO 
&DOUNTIL 
&DOWHILE 
&ELSE 
&ENDAFTER 
&IF 
&GOSUB 
&GOTO

More information:

&IF