[fpc-devel] fpc_ShortStr_To_WideStr

C Western mftq75 at dsl.pipex.com
Mon Mar 21 23:17:44 CET 2005


peter green wrote:

>oops looks like i commented out the wrong line when changing the
>widestringmanager system for improved flexibility.
>
>the code should be:
>
>Function fpc_ShortStr_To_WideStr (Const S2 : ShortString): WideString;
>{$ifdef hascompilerproc} compilerproc; {$endif}
>{
>  Converts a ShortString to a WideString;
>}
>Var
>  Size : SizeInt;
>begin
>  Size:=Length(S2);
>  //Setlength (fpc_ShortStr_To_WideStr,Size);
>  if Size>0 then
>    begin
>
>widestringmanager.Ansi2WideMoveProc(PChar(@S2[1]),fpc_ShortStr_To_WideStr,Si
>ze);
>      { Terminating Zero }
>
>PWideChar(Pointer(fpc_ShortStr_To_WideStr)+Size*sizeof(WideChar))^:=#0;
>    end;
>end;
>  
>
Thanks for the quick response. That fix works for me.
Colin




More information about the fpc-devel mailing list