hedgewars/uFLUtils.pas
branchqmlfrontend
changeset 10434 1614b13ad35e
child 10440 b74a7bbe224e
equal deleted inserted replaced
10432:b0abef0ee78c 10434:1614b13ad35e
       
     1 unit uFLUtils;
       
     2 interface
       
     3 
       
     4 function str2PChar(const s: shortstring): PChar;
       
     5 function intToStr(n: LongInt): shortstring;
       
     6 
       
     7 implementation
       
     8 
       
     9 var
       
    10     str2PCharBuffer: array[0..255] of char;
       
    11 
       
    12 function str2PChar(const s: shortstring): PChar;
       
    13 var i: Integer;
       
    14 begin
       
    15    for i:= 1 to Length(s) do
       
    16       begin
       
    17       str2PCharBuffer[i - 1] := s[i];
       
    18       end;
       
    19    str2PCharBuffer[Length(s)]:= #0;
       
    20    str2PChar:= @(str2PCharBuffer[0]);
       
    21 end;
       
    22 
       
    23 function intToStr(n: LongInt): shortstring;
       
    24 begin
       
    25     str(n, intToStr)
       
    26 end;
       
    27 
       
    28 end.