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 tiny = 1..10;<br />

VAR r : PACKED RECORD a : array[1..5] OF tiny END;<br />

PROCEDURE test(VAR x : ARRAY {low..high:integer] OF tiny);<br />

BEGIN<br />

END;<br />

BEGIN<br />

END.<br />

test(r.a) (r.a is packed}<br />

*ERROR 49 -- data cannot be output from an object of this type<br />

Appendix A<br />

A WRITE or PUT statement has attempted to output data from an object<br />

which cannot generate values, for example a PROCEDURE or a TYPE.<br />

PROGRAM fail(output);<br />

VAR x : SET of char;<br />

BEGIN<br />

END.<br />

y : RECORD z : integer END;<br />

write(x); (wrong}<br />

write(y.z); (ok}<br />

write(y); (wrong}<br />

*ERROR 50 -- a field width specification is not allowed here<br />

This message is issued when a parameter to write or writeln is followed by<br />

more field width specifications than are required.<br />

PROGRAM fail(output);<br />

VAR x : char;<br />

BEGIN<br />

END.<br />

x := '?';<br />

writeln(x:1:2); (only one field needed}<br />

*ERROR 51 -- an item to be output is required here<br />

The procedure WRITE must be given at least one value to be output. Note<br />

that WRITELN may be specified without any parameters.<br />

<strong>Pascal</strong> Issue 1 61

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

Saved successfully!

Ooh no, something went wrong!