This is NOT a bug. The compiler is correct.
It is exactly as it should be. In the first declaration, you redefine 'Integer' to be a variable, not a type. Then when you reach the second one (for 'Real'), Integer is no longer a type, and you get an error.
In your second form, 'Integer' is still a type, since both variables are being defined simultaniously. Therefore that one works.
Question: Why would you want to do this anyway? It is confusing.
If I were writing a Pascal compiler, I would be tempted to make some of these identifiers into keywords, for this very reason. Of course, then I would not meet the Pascal standards...
--- Eike Lange eike.lange@uni-essen.de wrote:
Hi Folks!
The following program fails to compile:
program Foo;
var Integer: Integer = 2; Real: Integer = 3 ; { this works: Real, Integer: Integer = 3; }
begin Integer := Real; Real := Integer end.
Btw: using the decalaration as given in the comment works.
Eike
===== ======= Frank D. Engel, Jr.
__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com