Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BitAnd() limitation?
Message
From
12/08/2004 13:59:25
 
 
To
12/08/2004 13:43:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00931430
Message ID:
00932857
Views:
21
Thank you - that works! i've been also working (just started) on a solution to convert the integer to binary string and then comparing the bits with a substring. the advantage would be that its almost unlimited - but would be slower.

thanks again for your intensive help!


>
>Thanks for your help again. i still have a problem (sorry). for the 1st 31 bits i get the error "missing expression". the rest evaluates correctly. i'll see if i can figure out the problem.
>

>
>
>AiaIaiaIai! You run on VFP6SP5 !
>
>On this, TRANSFORM(,"@0") not mask the 32 bits of the numeric value, and it return a
>"stars string" ( overflow in VFP computations ).
>
>then you have to return into a two way computation:
>
>
>CLEAR
>
>*** FULL TEST
>x=0
>? 'zero'
>?
>FOR k=0 TO 52
>	IF Test(m.x,m.k)
>  		?? TRANSFORM(m.k,"@R < 99 >")
>  	ENDIF
>NEXT
>* PREPARE A FULL 53 BITS SET TO 1
>FOR k=0 TO 52
>	x=m.x+2^m.k
>NEXT
>? '111...'
>
>FOR k=0 TO 52
>	IF Test(m.x,m.k)
>  		?? TRANSFORM(m.k,"@R < 99 >")
>  	ENDIF
>NEXT
>
>FUNCTION Test
>LPARA	MasterBit, TestBit
>
>#IF VERSION(5)>800
>	RETURN BITTEST(m.MasterBit*2^MIN(0,32*SIGN(31-m.TestBit)), m.TestBit%32)
>#ELIF VERSION(5)>600
>	RETURN BITTEST(EVALUATE(TRANSFORM(m.MasterBit*2^MIN(0,32*SIGN(31-m.TestBit)),"@0")), m.TestBit%32)
>#ELSE
>	RETURN IIF(m.TestBit<32	;
>			,BITTEST(m.MasterBit, m.TestBit)	;
>			,BITTEST(EVALUATE(TRANSFORM(m.MasterBit*2^MIN(0,32*SIGN(31-m.TestBit)),"@0")), m.TestBit%32))
>#ENDIF
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform