Sign in to follow this  
Followers 0
Champak

Multi If

7 posts in this topic

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.

Share this post


Link to post
Share on other sites



maybe

If BitAnd(GUICtrlRead($insert),$GUI_CHECKED) = $GUI_CHECKED Then
    Send("!+i")
Else
    MsgBox(0,0,"not checked")
Endif

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

if GUICtrlRead($send) = 1 or GUICtrlRead($insert) = 1 or Guictrlread($eq) = 1 Then
Send("{F3}")    
EndIf

if u just do =1 for the BEQs then its only going to check the BEQs for 1 u got to do the =1 for all

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

Thanks to both of you for helping in this part of my script. It's amazing the little things that one misses.

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
Sign in to follow this  
Followers 0