Monday, March 11, 2019

CASEDMO2

Table of Contents ] [ List of Example Programs ] [ CASEDMO2 Disk Image ]

CASEDMO2 is another short example program (Listing 7-6) that appears on page 92 of the book "Pascal Primer" by David Fox and Mitchell Waite. It demonstrates the use of a CASE statement with an INTEGER variable.


Note that while not used in this example, the Atari Pascal Language System has extended the CASE statement by adding an ELSE clause. If the case selecting expression would not result in the execution of a statement with the CASE, the ELSE clause is executed. ELSE simplifies error checking. It is likely that the execution of a similar unmatched CASE statement in UCSD Pascal would cause an undefined result.   

The link command looks like:

LINKER V1.0
*D2:CASEDMO2,PASLIB/S


When you run the program, it looks like:



No comments:

Post a Comment