Jump to content

Nested Select statements


Recommended Posts

Can't seem to get it to work, am I doing it right ?

Select
Case $1 = "Option A"
;do something
Case $1 = "Option B"
;do something
Case $1 = "Option C"
        Select
        Case $A = "Enabled"
        ;do something
        Case $A = "Disabled"
        ;do something
        EndSelect
Case $1 = "Option H"
;do something
EndSelect

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

A switch statement would probably be better in that case. I don't know why it wouldn't be working though. Maybe the problem is elsewhere in the code.

Switch $1
Case "Option A"
;do something
Case "Option B"
;do something
Case "Option C"
        Switch $A
        Case "Enabled"
       ;do something
        Case "Disabled"
       ;do something
        EndSelect
Case "Option H"
;do something
EndSelect
Link to comment
Share on other sites

Can't seem to get it to work, am I doing it right ?

Looks like logical code. Select Case can be nested. The problem could be the code that is setting the conditions before this Select Case is executed.

A switch statement would probably be better in that case. I don't know why it wouldn't be working though. Maybe the problem is elsewhere in the code.

Switch $1
Case "Option A"
;do something
Case "Option B"
;do something
Case "Option C"
        Switch $A
        Case "Enabled"
      ;do something
        Case "Disabled"
      ;do something
        EndSelect
Case "Option H"
;do something
EndSelect
Switch is AutoIt Beta only. You cannot close a Switch statement with EndSelect. You need to use EndSwitch. :lmao:
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...