28.06.2013 Views

ISO Pascal reference manual

ISO Pascal reference manual

ISO Pascal reference manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

*ERROR 130 -- declarations must appear in the order<br />

LABEL, CONST, TYPE, VAR, PROCEDUREs and FUNCTIONs<br />

Appendix A<br />

<strong>Pascal</strong> defines that the order of declarations must be: LABELs then<br />

CONSTs then TYPES then VARs then PROCEDUREs and FUNCTIONs<br />

in any order.<br />

PROGRAM fail;<br />

TYPE t = 1..10;<br />

VAR a : t;<br />

VAR b : integer; (wrong - repeated VAR}<br />

CONST one = 1; (wrong - just out of order}<br />

BEGIN<br />

END.<br />

*ERROR 131 -- a variable, function or procedure identifier is<br />

required here<br />

The compiler is expecting a statement of the form:<br />

OT<br />

variable := expression;<br />

procedureid;<br />

functionid := expression;<br />

PROGRAM fail;<br />

TYPE thing = 1..10;<br />

Var x : thing;<br />

BEGIN<br />

x := thing;<br />

END.<br />

*ERROR 132 -- may not be passed as a procedural parameter<br />

The <strong>Pascal</strong> standard does not allow any of the required procedures (or<br />

functions) to be passed as procedural (or functional) parameters. Function<br />

results, however, may be passed as value parameters.<br />

<strong>Pascal</strong> Issue 1 91

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

Saved successfully!

Ooh no, something went wrong!