If you specify the leave block action statement in a response inside a block, ESL will terminate the block when the leave block statement is executed. Execution continues at the action statement, if any, immediately following the end statement for the block in which the leave block statement is specified; for example:
action Logon is
send UserName "\r\n" to DJNS
begin Calidate
response to line "Enter Password" from DJNS
leave block
response to line "ERROR" from DJNS
action ErrorWait
end Calidate
# The following is executed only if
# UserName was a valid entry:
send Password "\r\n" to DJNS
begin CheckPn
response to line "Logged On" from DJNS
leave block
response to line "ERROR" from DJNS
action ErrorWait
end CheckPn
action SetupMenus
...
A leave block statement must be specified inside a response definition that is within the definition of the block itself. You cannot specify it in an action routine that is called from inside the block.
You can optionally specify a name in the leave block statement. This name specifies the outermost block that you want to leave. ESL terminates the block specified in the leave block statement, and all blocks nested within it. If you do not specify a name in the leave block statement, ESL terminates only the innermost active block.
Do not use a name in a leave block statement in a nested resumable block.