HP SunSoft Pascal 4.0 User Manual

Page 69

Advertising
background image

The Pascal Compiler

45

3

The Pascal main program,

with.p

(

with

statement)

program p;

type C = record re, im: integer end;

AC = array[1..2] of C;

RC = record C1, C2: C end;

PRC = ^RC;

procedure qq;

var

c: C;

ac: AC;

rc: RC;

prc: PRC;

begin

ac[1]:= c;

with ac[1] do

begin

re:= 1;

writeln(im);

end;

with prc^.C1 do

begin

writeln(im);

end;

end;

begin

qq;

end.

The commands to compile and
execute

with.p

hostname% pc -Rw with.p

Mon Feb 20 16:28:34 1995 with.p:

In procedure qq:

w 18280 variable c is used but never set

w 18260 variable rc is neither used nor set

w 18280 field prc^.C1.im is used but never set

hostname% a.out

0

*** a.out terminated by signal 11: segmentation violation

*** Traceback being written to a.out.trace

Abort (core dumped)

Advertising