It seems that const parameters of string types are passed by value, eg:
program peterT4;
type Str = String(1000);
var gs: Str;
procedure Doit( const s: Str ); begin if @s = @gs then begin WriteLn( 'OK' ); end else begin WriteLn( 'failed' ); end; end;
begin Doit( gs ); end.
fails.
I checked the code and it definitely looks like it is doing a copy.
I use a lot of long strings (2500) and so this seems like a serious problem to me...
Thanks, Peter.