Hi!
On Wed, Dec 04, 2002 at 05:56:09AM -0800, Frank D. Engel, Jr. wrote:
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.
I ever thought, that all things right of the colon must be types. Therfore, my example is right. A redifinition of a type is IMO of the following form:
type Integer = Cardinal (7);
Where var Integer: Integer; defines a vaiable called "Integer" of type Integer, which is completly different.
Question: Why would you want to do this anyway? It is confusing.
I just wanted to test this feature. Never thought of using it in "real programs", but it should be possible.
I really should read the standards... But this way, I'm learning Pascal.
Eike