In AL, there are instances where the syntax only allows the use of a single statement. However, a design may require the execution of several (or many) code statements.
AL provides at least two ways to address this need. One method is to have the single statement call a procedure that contains multiple statements.
However, inline coding is often more efficient to run and understand. So, AL provides a syntax structure to define a compound statement or block of code. A compound statement containing any number of statements can be used in place of a single code statement.
A compound statement is enclosed by the reserved words BEGIN and END. The compound statement structure looks like this:
BEGIN <Statement 1>; <Statement 2>; .. <Statement n>; END
The AL code contained within a BEGIN-END block should be indented by two characters, as shown in the preceding pseudocode snippet, to make it obvious that it is a block of code.