10-2 hex conversion of that process, I am glad that many friends have provided a concise than I want a good way, this is to see a friend's BLOG, the written conversion of 10-16 from the start I was also was wrong, Oh, will now remain in the correct blog, he asked to write their own conversion, rather than using a similar
Format ( 'Integer% 0: d in Hex is% 0: .8 x', [Value]);
Of course, there are simple way we have to use simple way oh Then introduced their own methods
var HexArr: array [1 .. 15] of string = ('1 ', '2', '3 ', '4', '5 ', '6', '7 ', '8', '9 ', 'A', 'B', 'C', 'D', 'E', 'F');
function Int2Hex (Value: Integer): string;
i: = 0;
while i <4 do
case i of
0: iTemp: = Value shr 24 and $ FF;
1: iTemp: = Value shr 16 and $ FF;
2: iTemp: = Value shr 8 and $ FF;
3: iTemp: = Value and $ FF;
if not Boolean (iTemp) then Result: = Result + '00 '
Result: = Result + HexArr [iTemp div 16];
Result: = Result + HexArr [iTemp mod 16];
Test: ShowMessage (Int2Hex (-1)); / / display FFFFFFFF
ShowMessage (Int2Hex (MAXINT)); / / display 7FFFFFFF
Hope that more suggestions, and personally feel quite concise, and Oh, obviously what it is doing each step
Delphi Tutorial Articles
Can't Find What You're Looking For?
Rating: Not yet rated
No comments posted.