Jump to content

Need some help with this


Recommended Posts

$Profile1 = "Option 1"

If GUICtrlRead($Profile1) = "Option 1" Then
MsgBox(0,"Test","Profile 1 = Option 1")    
endif

If GUICtrlRead($Profile1) = "Option 2" Then
MsgBox(0,"Test","Profile 1 = Option 2")    
endif

If GUICtrlRead($Profile1) = "Option 3" Then
MsgBox(0,"Test","Profile 1 = Option 3")    
endif

If GUICtrlRead($Profile1) = "Option 4" Then
MsgBox(0,"Test","Profile 1 = Option 4!")    
endif

It's probl a simple thing what im missing but now it displays all Options instead of the Option 1.

I only need it to select the option that the $Profile1 is set to.

Link to comment
Share on other sites

GuiCtrlRead is used to access a control, not a variable. Try this --

$Profile1 = "Option 1"

Switch $Profile1
Case "Option 1"
    MsgBox(0,"Test","Profile 1 = Option 1")    

Case "Option 2"
    MsgBox(0,"Test","Profile 1 = Option 2")    

Case "Option 3"
    MsgBox(0,"Test","Profile 1 = Option 3")    

Case "Option 4"
    MsgBox(0,"Test","Profile 1 = Option 4!")    

EndSwitch

 

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