Monday, March 11, 2019

CASEDMO3

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

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

This example program also uses a standard function ODD().


I ran into an issue when testing this example. The standard ODD function seems to work correctly, but it appears that using a BOOLEAN with a CASE doesn't seem to work in the Atari Pascal Language System. The manual appears to state that only non-real, short, scalar, or constants can be used with a CASE statement.

I'd suggest just using and IF-THEN-ELSE statement instead of a CASE statement when it comes to using BOOLEAN variables.

I added a couple of extra WRITELNs for debugging proposes.

The link command looks like:

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

When you run the program, it looks like:



No comments:

Post a Comment