Jump to content

Case / And terminology


prismite
 Share

Go to solution Solved by JohnOne,

Recommended Posts

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?

Link to comment
Share on other sites

  • Solution

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.

Link to comment
Share on other sites

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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

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