Jump to content

Multi If


Recommended Posts

Help please, I can't find the following two.

How can I say:

If this is checked OR this is checked OR this is checked, then check this, end if.

and

If this is checked OR this is checked OR this is checked, then do this, end if.

Also, I understand that I can check if a box is checked with:

$Binsert=GuiCtrlRead($insert)   
if $Binsert = 1 then        
Send("!+i")
Endif

But I don't understand how to check if it is not checked. I've tried "= 0 then" but no luck.

I looked this over

If BitAnd(GUICtrlRead($viewstatusitem),$GUI_CHECKED) = $GUI_CHECKED Then
thinking that was the solution, but couldn't quite wrap my head around it.

Thanks.

Link to comment
Share on other sites

I'm actually doing that already, but with this instead:

$Binsert=GuiCtrlRead($insert)   
if $Binsert = 1 then        
Send("!+i")
Else
 Blah blah
Endif

Problem is, there is something where it would have to actually be reversed, and it doesn't work like that. Ex:

$Binsert=GuiCtrlRead($insert)   
if $Binsert = 1 then        
 -------------------------this would be empty
Else
 -------------------------this would be the function
Endif

This is because this if function would activate on the box not being checked. And it seems that I can't leave an empty "then" statement. So then I guess the question would be, Does Autoit send or do "empty functions".

Also, really need to know if the if-or statement in the first post is possible with this, or a workaround please.

Edited by Champak
Link to comment
Share on other sites

maybe

If BitAnd(GUICtrlRead($insert),$GUI_CHECKED) <> $GUI_CHECKED Then
    MsgBox(0,0,"not checked")
Else
    MsgBox(0,0,"checked")
Endif

notice the <> above... it means "different than"

8)

Edit

this is also possible

If BitAnd(GUICtrlRead($insert),$GUI_CHECKED) = $GUI_CHECKED Then
   ; do nothing
Else
    MsgBox(0,0,"not checked")
Endif
Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

I went with the second one. Thanks. I figured out I was doing the "or" statements wrong. So now the script is not crapping out with errors as before with the "or" statements, but it's not reading them. This is what I've tried so far:

$BSends=GuiCtrlRead($send)
    $BInserts=GuiCtrlRead($insert)
    $BEQs=GuiCtrlRead($eq)
     if $BInserts Or _
        $BSends Or _
        $BEQs = 1 then
    Send("{F3}")

AND

$BSends=GuiCtrlRead($send)
    $BInserts=GuiCtrlRead($insert)
    $BEQs=GuiCtrlRead($eq)
     if $BInserts Or $BSends Or $BEQs = 1 then
    Send("{F3}")

Why isn't it reading?

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...