On 23 Feb 01, at 14:38, Oldham, Adam wrote:
Again, Porting from another version of ancient proprietary Pascal. In GPC, apparently strings run like this: 4 byte Capacity, 4 byte Length, then the string Data.
In my old compiler strings stored the length and only the length as a CHR(len) up to a length of 255. Where we could write statements like: string[0] := CHR(length); Is there a way to allow this in GPC,
No. But you can use 'SetLength' to set the length of the string.
if not is it being planned
That type of string that you are referring to is what is used in the old Turbo Pascal. I believe that something of that nature is being planned for GPC at some time in the future. I do not think that it is a high priority thing though.
or could someone point me in the direction to add a compiler flag to switch between the two?
No compiler switch will do it. GPC strings are currently implemented as schema. You will have to use 'SetLength' to set the length and 'Length' to get the length.
Also, if I have a String[15] and String[20] and I want to assign a variable with the value in string15, is there a way to get the compiler to not complain that the types are different?
Dunno.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) Author of: Chief's Installer Pro for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm Email: African_Chief@bigfoot.com