- Code: Select all Expand view
n := NUMTOHEX( 0x6965129d6c68406c93fa74c7ef2696b6 + 1 )
64-bit Exe only can handle this large value.
But 32 bit exe can not handle such large numbers
With 32-bit exe this is the result:
- Code: Select all Expand view
93FA74C7EF2696B7
For 32-bit exe, we can use this function with the same result:
- Code: Select all Expand view
function HexAddOne( cStr )
HB_INLINE( cStr ) {
char * text = ( char * ) hb_parc( 1 );
int iPos = hb_parclen( 1 );
char c = '0';
while ( iPos > 0 && c == '0' )
{
c = text[ --iPos ];
c = ( ( c == 'f' || c == 'F' ) ? '0' : ( c == '9' ? 'a' : c + 1 ) );
text[ iPos ] = c;
}
hb_ret();
}
return cStr
Using this function
- Code: Select all Expand view
? c := hexaddone( "6965129d6c68406c93fa74c7ef2696b6" ) // --> 6965129d6c68406c93fa74c7ef2696b7
This function works without any
limit on the size. Even hex strings larger than 32 bytes.