On 27 May 2004 at 1:26, Frank Heckenbach wrote:
[...]
Anyway, before deciding what to do, we'll have to know how other compilers behave exactly. Since BP has restrictions on result types, there aren't much cases that can occur (strings and pointers may be the only questionable ones).
I tested this program: type a = record i, j : integer end;
function b:string; begin b[1] := ' ' end;
function b1:string; begin result[1] := ' ' end;
function bb(i, j: integer) : a; begin bb.i := i; bb.j := j end;
function b3(i, j: integer) : a; begin result.i := i; result.j := j end; begin Writeln ('OK'); end.
This is the result of my tests: 1. Virtual Pascal compiles it. 2. FreePascal compiles it. 3. Delphi compiles it. 4. TMT Pascal accepts functions b, b1, and b3, but rejects bb with this error: " bb.i := i; ? Error: TEST.PAS (line 18, col 3): expression must be a RECORD or OBJECT"
5. We already know GPC's and BP's behaviour.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/