[fpc-devel] Re: dominant short strings in compiler source

L505 fpc505 at z505.com
Sun May 21 05:42:00 CEST 2006


>   writeln('Let''s combine a short string with a wordstring.. (press enter)');
>   readln;
>   sstring:= ', interesting world.';
>   WordStrConcat(sstring, wordstr1); // no memory allocated

sorry, forgot to include the actual shortstring overloaded function - my copy and paste
skills are getting poor.

{ concatenates a short string with a wordstring .. overloaded}
procedure WordStrConcat(const s1: shortstring; var dest: TWordStr);
begin
  move(pchar(@s1[1])^, pchar(@dest[WordStrLen(dest)+1])^, Length(s1));
end;





More information about the fpc-devel mailing list