aa2zz6 Posted May 13, 2018 Share Posted May 13, 2018 (edited) How do I return the results to a variable when a user inputs a integer inside a input box? #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> Global $result Global $hGUI = GUICreate("Example", 400, 100) Global $Inputbox = GUICtrlCreateInput("", 10, 30, 90, 20) Global $btn = GUICtrlCreateButton("Start", 0, 0, 85, 25) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn $result = userinput(GUICtrlRead($Inputbox)) ConsoleWrite($result) EndSwitch WEnd Func userinput($x) Sleep(1000) Send($x) EndFunc ;==>userinput Edited May 13, 2018 by aa2zz6 Link to comment Share on other sites More sharing options...
Earthshine Posted May 13, 2018 Share Posted May 13, 2018 Assign a variable to GUIControlRead command Instead of just using it as an argument to that user function. That way you could send it to that user function as well just the variable aa2zz6 1 My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
aa2zz6 Posted May 13, 2018 Author Share Posted May 13, 2018 Thanks, that did the job! Link to comment Share on other sites More sharing options...
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