25 Jul
2002
25 Jul
'02
8:43 p.m.
Dear gpc-ers, here is a question by an unskilled programmer: Upon the program program driver0; {$I complexop.p} var a,b,c,d: scomplex; begin a.re := 1; a.im := -0.1; b := a; c := b * b; c := a + c; d := c + b * b; writeln(c.re,' ',c.im); end. the gpc compiler reacts: driver0.p: In main program: driver0.p:10: reference expected, value given However if the incriminated line 10 (d := c + b * b) is commented out the program compiles and executes ok. The include file contains overloaded operations + and * for complex numbers as records. Can you tell what is wrong without looking into the (rather long) include file. Thanks in advance, K. Veselic.