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 -- http://home.pages.de/~Peter.Gerwinski/ - G-N-U GmbH: http://www.g-n-u.de Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-19990118 GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422 keys: ftp://ftp.gerwinski.de/pub/keys/ - AntiSpam: http://spam.abuse.net