Flow control
Process flow control functions
are the functions that execute the decision making and resultant logic branches in executable code. IF–THEN-ELSE
, discussed in Chapter 6, Introduction to C/SIDE and C/AL, is also a member of this class of functions. Here we will discuss the following:
REPEAT-UNTIL
WHILE-DO
FOR-TO
andFOR-DOWNTO
CASE-ELSE
WITH-DO
QUIT
,BREAK
,EXIT
, andSKIP
REPEAT-UNTIL
REPEAT-UNTIL
allows us to create a repetitive code loop which repeats a block of code until a specific conditional expression evaluates to TRUE
. In that sense, REPEAT-UNTIL
defines a block of code, operating somewhat like the BEGIN-END
compound statement structure which we covered in Chapter 6, Introduction to C/SIDE and C/AL. REPEAT
tells the system to keep reprocessing the block of code, while the UNTIL
serves as the exit doorman, checking if the conditions for ending the processing are true. Because the exit condition is not evaluated until the end of the loop, a REPEAT-UNTIL
structure will always process...