mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 10:49:30 +02:00
* removed hexstr(), already in RTL (and even supports 64 bit integers)
git-svn-id: trunk@2232 -
This commit is contained in:
parent
78447375dc
commit
60345fa78a
@ -66,7 +66,6 @@ interface
|
||||
function PadSpace(const s:string;len:longint):string;
|
||||
function GetToken(var s:string;endchar:char):string;
|
||||
procedure uppervar(var s : string);
|
||||
function hexstr(val : cardinal;cnt : cardinal) : string;
|
||||
function realtostr(e:extended):string;{$ifdef USEINLINE}inline;{$endif}
|
||||
function tostr(i : qword) : string;{$ifdef USEINLINE}inline;{$endif}overload;
|
||||
function tostr(i : int64) : string;{$ifdef USEINLINE}inline;{$endif}overload;
|
||||
@ -395,39 +394,6 @@ uses
|
||||
end;
|
||||
|
||||
|
||||
function hexstr(val : cardinal;cnt : cardinal) : string;
|
||||
const
|
||||
HexTbl : array[0..15] of char='0123456789ABCDEF';
|
||||
var
|
||||
i,j : cardinal;
|
||||
begin
|
||||
{ calculate required length }
|
||||
i:=0;
|
||||
j:=val;
|
||||
while (j>0) do
|
||||
begin
|
||||
inc(i);
|
||||
j:=j shr 4;
|
||||
end;
|
||||
{ generate fillers }
|
||||
j:=0;
|
||||
while (i+j<cnt) do
|
||||
begin
|
||||
inc(j);
|
||||
hexstr[j]:='0';
|
||||
end;
|
||||
{ generate hex }
|
||||
inc(j,i);
|
||||
hexstr[0]:=chr(j);
|
||||
while (val>0) do
|
||||
begin
|
||||
hexstr[j]:=hextbl[val and $f];
|
||||
dec(j);
|
||||
val:=val shr 4;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function DStr(l:longint):string;
|
||||
var
|
||||
TmpStr : string[32];
|
||||
|
Loading…
Reference in New Issue
Block a user