On 22 Oct 2004 at 14:53, Frank Heckenbach wrote:
Currently GPC allows function results in `with' statements, as in:
program foo;
type a = record b, c: Integer end;
function f: a; begin f := a[b: 2; c: 3]
Delphi does not accept this. It gives this error: E:\temp\foo.pas(10) Error: '(' expected but '[' found E:\temp\foo.pas(10) Error: 'END' expected but ']' found
end;
begin with f do WriteLn (b, c); end.
However, GPC currently also allows assignments to the components, such as:
with f do b := 2
which is quite clearly wrong.
Delphi allows this, but the assignment actually achieves nothing. This is dangerous. Therefore, I agree that it should be forbidden.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/