Sign in to follow this  
Followers 0
Fossil Rock

Nested Select statements

5 posts in this topic

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

Share this post


Link to post
Share on other sites



I'm not sure about the nested Select statements, but I know you could change the nested one to If/ElseIf/Else/EndIf and it would work.

Share this post


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

Share this post


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

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