Hello,

I've a problem trying to convert a string in hex to decimal.
When I do this:
test = (Val("&H9000") AND 65535)
I obtain
test = -28672 (equals to 0xFFFFFFF9000)
and it should be
test = 36864 (0x9000)

And when I debug it step by step I obtain what you can see in this
screenshot.
[image: Pantallazo-1.png]
This example seems very stupid (and it is), I did it because I noticed that
this code
test = Val("&H" & TextBox1.Text)
didn't work fine with TextBox1.Text="9000" and maybe with other values. Then
I tried to "cut" with AND with &HFFFFF but it didn't work so I changed it to
its decimal conversion 65535 and now at least the debugger shows the correct
value but it doesn't asign it to test.

I'm using Gambas 2.20.2  in Ubuntu 9.10 with 2.6.31-20-generic kernell

Thankyou

Rafa

<<Pantallazo-1.png>>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to