Home > Back-end >  Questions about TStringGrid use IntToHex??
Questions about TStringGrid use IntToHex??

Time:10-16

When I was in the use of BCB TStringGrid I want him to show the Hex format I used the IntToHex, but I found that if the conversion value greater than 0 x80 he will become a show 0 XFFFFFFXX feeling is when he encounters a negative number will be converted to 0 XFFFFFXX is there a way to solve this problem let him not judge a negative number,

CodePudding user response:

Use unsigned data type casting, such as:
IntToHex ((BYTE) n, 2);
Or
IntToHex (n (WORD), 4);

CodePudding user response:

Top

CodePudding user response:

Thanks for demon elder brother feasible answer ~ ~ ~
  • Related