212
Pascal 4.0 User’s Guide
9
Scalar Error Messages
Error messages stating that scalar (user-defined) types cannot be read from and
written to files are often difficult to interpret. In fact, if you define:
type color = (red, green, blue)
standard Pascal does not associate these constants with the strings
red
,
green
,
and
blue
in any way. Pascal adds an extension so that enumerated types can
be read and written; however, if the program is to be portable, you must write
your own routines to perform these functions.
Standard Pascal only allows the reading of characters, integers, and
real
numbers from text files, including
input
(not strings or
boolean
s). You can
make the following declaration:
file of color
However, the representation is binary rather than as strings, and it is
impossible to define
input
as other than a text file.
Expression Diagnostics
The diagnostics for semantically ill-formed expressions are explicit, as the
following program shows. This program,
expr.p
, is admittedly far-fetched,
but illustrates that the error messages are clear enough so you can easily
determine the problem in the expressions.
Summary of Contents for SunSoft Pascal 4.0
Page 14: ...xiv Pascal 4 0 User s Guide ...
Page 16: ...xvi Pascal 4 0 User s Guide ...
Page 30: ...6 Pascal 4 0 User s Guide 1 ...
Page 160: ...136 Pascal 4 0 User s Guide 6 ...
Page 268: ...244 Pascal 4 0 User s Guide 11 ...
Page 320: ...296 Pascal 4 0 User s Guide B ...
Page 331: ...Index 307 ...
Page 333: ......