pTAL Conversion Guide

Statements
pTAL Conversion Guide—527302-002
15-10
Empty CASE Statements
Empty CASE Statements
TAL
The TAL compiler allows an empty, unlabeled CASE statement—that is, a CASE
statement in which there are no alternatives, as in Example 15-10 on page 15-10.
pTAL
The native compiler requires that a CASE statement include at least one alternative,
even if no statements are specified for that alternative.
Example 15-10 on page 15-10 is invalid in pTAL.
Example 15-11 on page 15-10 is valid in TAL and pTAL.
INT(32) Expression in a CASE Statement Index or Selector
In pTAL (but not TAL), the index of an unlabeled CASE statement and the selector of a
labeled CASE statement can be INT(32) expressions.
Example 15-10. Empty CASE Statement (TAL)
CASE i OF
BEGIN
END;
Example 15-11. Empty CASE Statement (pTAL)
CASE i OF
BEGIN
; ! Semicolon creates an alternative
END;
Example 15-12. CASE Statement With INT(32) Expressions as Labels
INT(32) i;
CASE i OF
BEGIN
...
END;
CASE i OF
BEGIN
0-> ...
1-> ...
END;