Friday, March 15, 2019

INTCONST

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

INTCONST is an example program (Listing 9-9) from page 122 of the book "Pascal Primer" by David Fox and Mitchell Waite.

The program takes an INTEGER and attempts to convert it to a STRING. It is the opposite of the VALDEMO example program. It doesn't take any input from the user. It uses the predefined value MAXINT (32767) and converts it to a STRING. This program makes use of the string INSERT procedure. It also uses the ABS function. Since the Atari Pascal built-in ABS() function is buggy, I overrode it with my own simple ABS() function.


The link command looks like:

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

When you run the program, it looks like:



No comments:

Post a Comment