Jump to content

Buttons and Variables


Guest Nocturne
 Share

Recommended Posts

Guest Nocturne

Ok Im still learning here, but I have not found anything in the read me or on the forums. Here are my questions

1. When making a GUI Box with an OK and Cancel buttons in it, How do I set it so that if the person clicks on the OK button I made it will continue to run the program.

2. How do you get a Variable to display something else. For example If a person were to select the number 2 from a radio button, how do I set it so it writes out the letters two. Or anything else

Anything would help, and thanx

Link to comment
Share on other sites

1. When making a GUI Box with an OK and Cancel buttons in it, How do I set it so that if the person clicks on the OK button I made it will continue to run the program.

2. How do you get a Variable to display something else. For example If a person were to select the number 2 from a radio button, how do I set it so it writes out the letters two. Or anything else

@1. If you mean how do you close the GUI and break out of the loop that is watching for GUI activity, when the OK button is clicked, do the following:

a. Use the ExitLoop function to break out of the loop.

b. Just below the loop, use the GUIDelete() function to remove the GUI. Before removing the GUI, make sure you get any data from it that you need.

c. Then "continue" the script.

@2. You have to construct a means to do so yourself. There are many ways to do this. Here are two:

; method 1
$iVar1 = 2
Select
    Case $iVar1 = 1
        Msgbox(4096, "", "One")
    Case $iVar1 = 2
        Msgbox(4096, "", "Two")
    Case Else
        Msgbox(4096, "", $iVar1)
EndSelect

; method 2
$iVar1 = 3
$aX = stringsplit("One,Two,Three,Four", ",")
MsgBox(4096, "", $aX[$iVar1])

Phillip

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