Nice, hopefully it works out.
About the '4097', you can test for individual bits with And:
I found the types that are used in msdn are here:
http://msdn2.microsoft.com/en-us/library/aa505945.aspx
And indeed, the msdn 'short' seems to be signed:
"A 16-bit integer (range: –32768 through 32767 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit."
So I guess that needs a bit conversion. Not completely sure how though, maybe something like 'number And $effffff' ?
About the '4097', you can test for individual bits with And:
num = Input ("value=") p = 1 For i = 1 To 16 If (num And p) = p Then Print p p = p * 2 Next WaitKey() End
I found the types that are used in msdn are here:
http://msdn2.microsoft.com/en-us/library/aa505945.aspx
And indeed, the msdn 'short' seems to be signed:
"A 16-bit integer (range: –32768 through 32767 decimal). The first bit (Most Significant Bit (MSB)) is the signing bit."
So I guess that needs a bit conversion. Not completely sure how though, maybe something like 'number And $effffff' ?