Hello,
It seems that IDOS->HexToLong doesn't work always as it should.
uint32 l_number;
IDOS->HexToLong("0x880800",&l_number);
=> l_number is: 8 914 944 OK
uint32 l_number;
IDOS->HexToLong("0x88080000",&l_number);
=> l_number is: -2012741632 ? Was waiting for 2 282 225 664
As l_number is a uint32, it should be able to store a value until 4 294 967 295, no ?
Any ideas?
Thank you.
Glames
Issue with IDOS->HexToLong
- thomasrapp
- Posts: 310
- Joined: Sat Jun 18, 2011 11:22 pm
Re: Issue with IDOS->HexToLong
Erm, an uint32 cannot store negative numbers. If your program prints -2012741632, then something's wrong with how you print the result.
If you want to see unsigned numbers, you should use %u and not %d.
Try:
printf ("%ld %lu\n",0x88080000,0x88080000);
and you'll see that everything is correct except your debugging.
If you want to see unsigned numbers, you should use %u and not %d.
Try:
printf ("%ld %lu\n",0x88080000,0x88080000);
and you'll see that everything is correct except your debugging.
Re: Issue with IDOS->HexToLong
Hi Thomas,
You're right. Thank you. I was using %l
Have a nice day,
Glames
You're right. Thank you. I was using %l
Have a nice day,
Glames