Sign in to follow this  
Followers 0
prismite

Case / And terminology

4 posts in this topic

Hi All.

I'm trying to configure a script that has multiple options, one of which is chosen by clicking a Radio button. It seems tricky to get this done because the typical radio button has to be 'read' first, so I'm having trouble locking down my terminology...

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
      Case $GUI_EVENT_CLOSE
            Exit
         Case $Button1 AND $Radio11

Above is obviously wrong, but it should convey what I'm trying to do. I've tried this, too:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
      Case $GUI_EVENT_CLOSE
            Exit
         Case $Button1 AND BitAND(GUICtrlRead($Radio11), $GUI_Checked)

The end result in both is that it continually executes this case, despite no button/radio selected.

Ideas?

Share this post


Link to post
Share on other sites



While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
      Case $GUI_EVENT_CLOSE
            Exit
         Case $Button1
            If BitAND(GUICtrlRead($Radio11), $GUI_Checked) Then
                  ;stuff
            Else
                  ;different stuff
            EndIf


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Replace AND with a comma (,) and try again (1st code)

In the 2nd code Case $Button1 AND BitAND(GUICtrlRead($Radio11), $GUI_Checked) makes no sense! Check out J1's example!

Br,
UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
      Case $GUI_EVENT_CLOSE
            Exit
         Case $Button1
            If BitAND(GUICtrlRead($Radio11), $GUI_Checked) Then
                  ;stuff
            Else
                  ;different stuff
            EndIf

 

OMG. So simple that I missed it. You, sir, are a wizard of a man. Thanks to J1 and Uez!

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