[fpc-pascal]Bug with a record type?
James_Wilson at i2.com
James_Wilson at i2.com
Mon Feb 19 21:24:19 CET 2001
Hansi, Johan;
> You declared DataFromFile as a record of Pointers (^DataRecord),
> but you try to access it as it was an array of record. Write the
> above line as: if DataFromFile [CurrentLine]^.Display then so i
> should work.
> I don't know anything about VP, so I dont' understand why it
> compiles this except if you made a typemistake in the code above,
> but you are declaring an array of POINTERS to DataRecord, not of
> the records themself. So you have to use
> DataFromFile[CurrentLine]^.Display;
You're both correct -- I was looking right past that. It's even more
amazing that VP compiled and ran the program just fine using the exact same
source (and no, there wasn't any typing mistake -- I used cut and paste to
take the code directly from the source file itself). Perhaps I should be
sending an email to Allan at VP now... :-)
Jim
More information about the fpc-pascal
mailing list