Jump to content

Return the results to a variable when a user inputs a integer inside a input box?


 Share

Recommended Posts

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