Hi Michael,
I usually translate 0xNNN... hexanumbers like &h0NNN..., that makes them unsigned. But in this case it does not seem to do difference.
But I think your code works, except the first line, where your duplication of N makes trouble.
I would write it as:
[code=thinbasic]
Local n As Integer = 32
While Not ( ANDB(x, &h080000000)) And (n > 0)
Decr n
SHIFT LEFT x,1
Wend
Return N
[/code]
... as ThinBasic has return as well.
Petr
Bookmarks