Moore, Jason wrote:
I am a novice gpc user trying to port some code from an old Unix compiler to gpc. We have the following scattered throughout the code. Most of this code was written before I got here, so I take no credit. [...] PPtr^[0] := CHR(I);
This works in UCSD and Borland Pascal but violates ISO 10206 Extended Pascal standard. It depends on the length of the string stored in the zeroth character - which is not the case in GPC which reserves (on 32-bit machines) four bytes for the length of the string.
The correct solution is to set the length of the string with the `SetLength' procedure:
SetLength ( PPtr^, I );
Hope this helps,
Peter