Jump to content

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


algiuxas
 Share

Recommended Posts

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

After switching years ago to Linux, sadly I don't use AutoIt anymore.

Link to comment
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"

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...