On 14 Jun 2000, at 17:51, Pierre Muller wrote:
Currently my patches only support Free Pascal strings and I have no idea of the current support of pascal string in GNU pascal, could someone please enlight me?
I use gdb sometimes (but not to a great extent). What would you like to know about GPC strings?
Do you have a Turbo Pascal like one ?
Not quite.
Ii.e. a 256 byte long array with the length at index zero ?
No. Strings can be of any length, although the declaration 'String' without specifying any length will default to a string of 255 characters.
(is the length stored in a single byte or not ?)
No. AFAIK GPC strings are implemented as (or similarly to) extended pascal schema. So there is a 'capacity' field, etc., and you have to get the length of the string by calling a function - e.g., 'Length (s)'. Index zero, as far as I can understand, does not exist. Trying to access it should generate a compile-time error.
Because strings are (like?) schema, and for other reasons, you can declare all these:
Type foo = string (512000); bar = string [1024*1024]; foobar = string; { will generate a warning and default to 255 }
In any of these cases, 'Sizeof (foo)', etc., will not be what you might normally expect. For example, with: 'var s : string [3];', 'Sizeof (s)' will be a lot bigger than 3, because 's' is internally a schema that has a number of fields.
Do you use pchar and normal strings or Turbo Pascal like ?
I am not sure that I fully understand this question. pChars exist under GPC, just as under BP/Delphi, and there are functions to manipulate them in the strings unit.
(if you use pchar, do you support #0 chars inside your pchars?)
I can't remember.
Do you also have AnsiString support a la Delphi ?
Not (yet).
Best regards, The Chief ----- Dr Abimbola A Olowofoyeku (The African Chief) Email: African_Chief@bigfoot.com Author of Chief's Installer Pro v5.22 for Win32 http://www.bigfoot.com/~African_Chief/chief32.htm