kevinward13 Posted June 8, 2011 Posted June 8, 2011 After my first script in which water helped a great deal...thanks water! I decided to try and expand my knowledge and write a script that will further enahnce the one previous. this time i am attempting to make it look pretty. so here goes. Global $uName, $uPass, $uServer Getlogin() ;RemedyLogin() Func GetLogin() Local $IUserName, $msg, $Sub_Button, $No_Sub GUICreate("Enter Username...", 250, 80) GUISetState(@SW_SHOW) $IUserName = GUICtrlCreateInput("", 70, 10, 170, 20) $Sub_Button = GUICtrlCreateButton("Submit", 55, 50, 100) $No_Sub = GUICtrlCreateButton("Cancel", 190, 50, 50) GUICtrlCreateLabel("Username:", 10, 10) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Sub_Button $uName = $IUserName MsgBox(0, 'Testing', $uName) Case $msg = $No_Sub ExitLoop EndSelect WEnd EndFunc Works sort of. I get the nice pop up window and the buttons work, however I have been trying to get the local variable in the function to be set to a global one so i can use it in another function. Right now it returns "3" What am i doin wrong?
kaotkbliss Posted June 8, 2011 Posted June 8, 2011 you need to GuiCtrlRead your $IUserName when the submit button is clicked, that will "read" the contents of the input 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
UEZ Posted June 8, 2011 Posted June 8, 2011 You read out the control id not its value! Try this line instead: $uName = GUICtrlRead($IUserName) Br, 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!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
kevinward13 Posted June 8, 2011 Author Posted June 8, 2011 you need to GuiCtrlRead your $IUserName when the submit button is clicked, that will "read" the contents of the input yea i knew that
kevinward13 Posted June 8, 2011 Author Posted June 8, 2011 Feel proud my Graduates! U passed the exam with flying colors
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now