In the GPC docs I found that UCSD (BP) strings are on the todo list for the compiler.
Below is an outline for an intermediate solution I write for the Macintosh Toolbox. The "Carbon" API has 700 (!) references to UCSD-Pascal strings. For binary compatibility, I have little choice.
If appropriate, I will be pleased to write runtime support routines (in Pascal) for UCSD strings, when they are getting integrated into the compiler.
Regards,
Adriaan van Os
-----------------
TYPE Str255 = PACKED RECORD Length: byte; chars: packed array[ 1..255] of char END; Str32 = PACKED RECORD Length: byte; chars: packed array[ 1..32] of char; pad: char {for binary compatibility} END; {etcetera}
OPERATOR + ( const theStr1 : Str255; const theStr2 : Str255) AD: Str255;
OPERATOR = ( const theStr1 : Str255; const theStr2 : Str255) EQ: Str255;
OPERATOR > ( const theStr1 : Str255; const theStr2 : Str255) GT: Str255;
OPERATOR < ( const theStr1 : Str255; const theStr2 : Str255) ST: Str255;
OPERATOR >= ( const theStr1 : Str255; const theStr2 : Str255) GE: Str255;
OPERATOR <= ( const theStr1 : Str255; const theStr2 : Str255) SE: Str255;
Plus: (1) standard routines Pos, Insert, Delete and Concat (2) conversion routines from and to string-constants and GPC "long strings".
Adriaan van Os wrote:
In the GPC docs I found that UCSD (BP) strings are on the todo list for the compiler.
Below is an outline for an intermediate solution I write for the Macintosh Toolbox. The "Carbon" API has 700 (!) references to UCSD-Pascal strings. For binary compatibility, I have little choice.
If appropriate, I will be pleased to write runtime support routines (in Pascal) for UCSD strings, when they are getting integrated into the compiler.
Unfortunately, the runtime support is not the main problem, the compiler support is (type-checking, automatic conversions etc.). In fact, most RTS routines won't even have to be changed if the compiler does the conversions automatically.
Frank