Martin Liddle wrote:
The first program simply writes a data file and performs as expected. The second program reads the data back. Under 20010604 it performs as expected. Under 20011123 the values for class are 513, 1026 and 2051. For the problem to be shown then it is necessary for the definitions to be in a separate unit. If the definitions and procedures are in the main body of the program then everything works correctly.
Again, the test program was quite necessary. The bug was in the interface (GPI) mechanism, and just happened to affect packed records (and possibly other things as well, though I haven't observed any). (martin2a.pas, and martin2b.pas for an even simpler example that showed the bug)
Patch attached (though it was made against otherwise modified sources; if you can't apply it, you'll have to wait for Peter's next upload).
Frank