algiuxas

Function Help 1,2,4,8,16,32,64,126,256...

5 posts in this topic

Hello,

I forgot one function, can somebody remind me it?
It works like this:

If ???($number,$searchfornumber) = True then ...
$number is for example:416 (256+128+32)
$searchfornumber is for example 128 and it should return 1, others, like 16 should return 0.

What function it is? I totaly forgot it... :/

Thanks


42783.png

Share this post


Link to post
Share on other sites



HaveAnEfficientLookInTheHelpFile()  ?

1 person likes this

Share this post


Link to post
Share on other sites

BitAnd ?

Thanks, I was looking for this function!


42783.png

Share this post


Link to post
Share on other sites
Func _ArrGetVal($Value)
    If $Value = 0 Then Return
    Local $sOut, $n = 0.5
    For $i = 0 To Int(Log($Value) / Log(2))
        $n *= 2
        If BitAND($Value, $n) Then $sOut &= '0x' & Hex(Int($n), 8) & @LF
        ; If BitAnd($Value, $n) Then $sOut&='0x'&StringFormat("%08x", $n) &@LF
        ; If BitAnd($Value, $n) Then $sOut&=StringFormat("%#x", $n) &@LF
    Next
    Return StringTrimRight($sOut, 1)
EndFunc   ;==>_ArrGetVal

I used in the program "CaptureText"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now