![]()  | 
REBOL for COBOL programmers | 
EXIT
Date written: March 29, 2013 This page explains some REBOL equivalents of EXIT. COBOL EXITThe most common use of the EXIT statement seems to be in a situation like the one below, where a paragraph containing the EXIT verb can be used for escaping out of some procedure. 
PERFORM paragraph-name-1 THRU paragraph-name-2.
...
paragraph-name-1.
    IF (some error condition)
        GO TO paragraph-name-2.
    (code to execute if no error)
paragraph-name-2.
    EXIT.
The REBOL equivalentThere is an "exit" function in REBOL that can be used in a similar way to quit a function. For example, 
function-name-1: does [
    if (some error condition) [
        exit
    ]
    (code to execute if no error)
]
...
function-name-1   ;; Call the above function
 |