Jump to content

Recommended Posts

Posted (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 by aa2zz6
Posted

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

My resources are limited. You must ask the right questions

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...