TAL Programmer's Guide
Formatting Programs
Structuring Programs
096254 Tandem Computers Incorporated 3–17
Using Semicolons Use semicolons to end each data declaration and to separate successive statements.
Ending Data Declarations
Here is an example of using semicolons to end data declarations:
INT num1;
INT num2;
INT num3;
STRING char1;
STRING char2;
The following example is equivalent to the preceding example:
INT num1, num2, num3;
STRING char1, char2;
Separating Successive Statements
You must use a semicolon between successive statements. A semicolon before the last
END keyword of a procedure or subprocedure is optional.
PROC myproc;
BEGIN
INT num1;
INT num2 := 8;
INT total;
num1 := 9; !Required semicolon
total := num1 + num2; !Optional semicolon
END;
Using Semicolons Within Statements
Within a statement:
You can use a semicolon before the END keyword that terminates a compound
statement.
You cannot use a semicolon just before an ELSE or UNTIL keyword.
IF a < b THEN
BEGIN
a := 1;
b := 2; !Optional semicolon
END !No semicolon here
ELSE
a := 0;
DO
a := a + b !No semicolon here
UNTIL
a < b;