| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Wed May 14, 2008 4:39 am Post subject: can anyone explain to me just one line of code? (bitwise &am |
|
|
hello
i saw this code in help
i know it works. i just would like to UNDERSTAND it
| Code: | WinGet, Style, Style, My Window Title
if (Style & 0x8000000) ;<--------- This line
... the window is disabled, so perform appropriate action. |
for example.
that Style variable will be 0x14CF0000 if i tried with notepad
but how was that code could know if 0x8000000 is in Style variable or not?
0x8000000 in 0x14CF0000?
i know it's hexadecimal and this bitwise operator does something that i don't understand
can anyone explain to me how it works theoretically?
Thanks in advance! |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1143 Location: Denmark
|
Posted: Wed May 14, 2008 8:37 am Post subject: |
|
|
Bitwise operation _________________ there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face
- Kashmir |
|
| Back to top |
|
 |
Guest
|
Posted: Wed May 14, 2008 9:12 am Post subject: |
|
|
ok thank for answer tonne
i think i understand it a bit now
in autohotkey, every integers are decimal right?
can i operate in binary directly?
something like Msgbox % 1111 ^ 0101 ? |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 883
|
Posted: Wed May 14, 2008 9:34 am Post subject: |
|
|
| Anonymous wrote: | can i operate in binary directly?
something like Msgbox % 1111 ^ 0101 ? |
yes, but not with that syntax. There are functions on the forums which convert decimal to binary (hex), or you can just use hex. If you know what you're doing, you don't need to work in hex to use the bitwise operators, since an integer is an integer is an integer.
| Code: | msgbox % 0xF ^ 5
SetFormat, Integer, Hex
msgbox % 0xF ^ 5 |
_________________ My Home Thread
More Common Answers: 1. It's in the FAQ 2. Ternary ( ? : ) guide 3. Post code with [code][/code] tags |
|
| Back to top |
|
 |
Guest
|
Posted: Wed May 14, 2008 9:44 am Post subject: |
|
|
| [VxE] wrote: | | an integer is an integer is an integer. |
thanks for answer VxE
i know what you mean
you mean numeric system doesn't matter cause it's just how it looks right?
i just curious if my input can be distinguished as binary directly
because i'm not familiar with numeric system conversion
i'm so confused
why isn't there SetFormat, Integer, Binary
i want to operate like 1111 ^ 0101 not 15 ^ 5 or 0xF ^ 5
because it's so confusing to me |
|
| Back to top |
|
 |
Guest
|
Posted: Wed May 14, 2008 9:56 am Post subject: |
|
|
Got it!  |
|
| Back to top |
|
 |
Guest
|
Posted: Wed May 14, 2008 10:26 am Post subject: |
|
|
| Anonymous wrote: | Got it!  |
it wasn't me (original poster)  |
|
| Back to top |
|
 |
Guest
|
Posted: Wed May 14, 2008 11:04 am Post subject: |
|
|
| Nor me!! |
|
| Back to top |
|
 |
Guest
|
Posted: Wed May 14, 2008 11:07 am Post subject: |
|
|
It was me, Guest. So what?  |
|
| Back to top |
|
 |
|