9

To make the assignment statement work, you must declare a type and use it to declare the variables, as follows:

type

r = record

a:integer;

b:char;

end;

var

x:r;

y:r;

Alternatively, you could use the declaration:

x, y : record

a:integer;

b:char;

end;

The assignment statement then works.

Unreachable Statements

Pascal flags unreachable statements. Such statements usually correspond to errors in the program logic, as shown in the following example:

The Pascal program, unreached.p

program unreached_example(output);

label 1;

begin goto 1; writeln('Unreachable.'); 1:

writeln('Reached this.'); end. { unreached_example }

Error Diagnostics

215

Page 239
Image 239
HP SunSoft Pascal 4.0 manual Unreachable Statements, Pascal program, unreached.p, Error Diagnostics 215