28.06.2013 Views

ISO Pascal reference manual

ISO Pascal reference manual

ISO Pascal reference manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PROGRAM fail;<br />

TYPE ok = (red, yellow, green, blue);<br />

PROCEDURE thing;<br />

CONST bad1 = —'a';<br />

BEGIN<br />

END;<br />

BEGIN<br />

END.<br />

bad2 = +green;<br />

*ERROR 63 -- this type must not have a component which is a file<br />

In certain contexts <strong>Pascal</strong> places the restriction on the type of acceptable<br />

objects that they must not have any component which has the type FILE.<br />

PROGRAM fail;<br />

TYPE rf = RECORD j : integer;<br />

END;<br />

VAR a, b : rf;<br />

BEGIN<br />

END.<br />

f : FILE OF real<br />

a := b; (cannot copy records containing files}<br />

*ERROR 64 -- a type specification is required here<br />

This message indicates that a general type specification is needed, that is,<br />

either the name of a type or an explicit type definition such as 1..10.<br />

PROGRAM fail;<br />

VAR j,k:; (no type given}<br />

BEGIN<br />

END.<br />

*ERROR 65 -- the identifier of a type which defines a range of values is<br />

required here<br />

Certain types in <strong>Pascal</strong>, known as 'ordinal types', define ranges of values.<br />

These types are: integer, char, Boolean and all enumerated types. In<br />

addition any type which is a subrange of these is an ordinal type. Whenever<br />

66 <strong>Pascal</strong> Issue 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!