hedgewars/uFLUtils.pas
branchqmlfrontend
changeset 10616 20a2d5e6930a
parent 10517 844bd43db47a
child 10757 f71275973737
equal deleted inserted replaced
10614:4afb4c4bf495 10616:20a2d5e6930a
     1 unit uFLUtils;
     1 unit uFLUtils;
     2 interface
     2 interface
     3 
     3 
     4 function str2PChar(const s: shortstring): PChar;
     4 function str2PChar(const s: shortstring): PChar;
     5 function intToStr(n: LongInt): shortstring;
     5 function intToStr(n: LongInt): shortstring;
       
     6 function strToInt(s: shortstring): LongInt;
     6 function midStr(s: shortstring; pos: byte): shortstring;
     7 function midStr(s: shortstring; pos: byte): shortstring;
     7 procedure underScore2Space(var s: shortstring);
     8 procedure underScore2Space(var s: shortstring);
     8 
     9 
     9 implementation
    10 implementation
    10 
    11 
    25 function intToStr(n: LongInt): shortstring;
    26 function intToStr(n: LongInt): shortstring;
    26 begin
    27 begin
    27     str(n, intToStr)
    28     str(n, intToStr)
    28 end;
    29 end;
    29 
    30 
       
    31 function strToInt(s: shortstring): LongInt;
       
    32 begin
       
    33 val(s, strToInt);
       
    34 end;
       
    35 
    30 function midStr(s: shortstring; pos: byte): shortstring;
    36 function midStr(s: shortstring; pos: byte): shortstring;
    31 begin
    37 begin
    32     midStr:= copy(s, pos, length(s) - pos + 1)
    38     midStr:= copy(s, pos, length(s) - pos + 1)
    33 end;
    39 end;
    34 
    40