HP SunSoft Pascal 4.0 Manuel d'utilisateur Page 236

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 333
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 235
212 Pascal 4.0 Users 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 booleans). 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.
Vue de la page 235
1 2 ... 231 232 233 234 235 236 237 238 239 240 241 ... 332 333

Commentaires sur ces manuels

Pas de commentaire