>>hello everybody.
>>
>>it seems, in Vfp6 Sp5, that the following works:
>>
>>?bitand(2^30, 2^30) = 2^30
>>but the next one does not
>>?bitand(2^31, 2^31) = 2^31
>>
>>is this the limitation of BitAnd()?
>>
>>if so, is there a workaround? currently i need to be able to check for values up to 2^33
>>
>>thanks for all your help in advance!
>
>Definitely a limitation on BITAND and the other bit functions. They can only work on 32 bit numbers, but it seems it won't work on the 32nd bit as that's the sign bit. The help doesn't even mention 32 bits, but I think that's the case.
>
>Some of the bit commands mention bits 0-31 and some don't. Also, I don't think you're using BITAND correctly, it returns the bits that are common to the parameters you pass, not a .T./.F. return value.
>
>?TRANSFORM(BITAND(2^31,2^31),"@0x")
>
>prints a value of 0x80000000, which is correct.
hello Fred
thanks for your response. the Transform() solution might work, i'll have to check that tomorow. i am using this not to find the common bit, but to allow for different options in my program, something simular to the messagebox function with the different options.
3 Yes, No, and Cancel buttons
16 Stop sign
256 Second button
BitAnd(3+16+256, 3) = 3
BitAnd(3+16+256, 16) = 16
BitAnd(3+16+256, 256) = 256
i then can find which, multible, options where choosen. i have 33 options at this time (they might be more in the future). actually this is not a user function i have, but a program which i need to be flexible enough to be able to change at any time.