Nexx Posted February 4, 2011 Share Posted February 4, 2011 Hello. Look at this script: expandcollapse popupHOTKEYSET("{F5}", "parar") Func PARAR() Exit 0 EndFunc _Hello() #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 126) $n1 = GUICtrlCreateInput("", 40, 24, 145, 21) $n2 = GUICtrlRead($n1) GUICtrlSetBkColor(-1, 0xFFFFFF) $Button1 = GUICtrlCreateButton("Read", 88, 64, 97, 57) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() if $nMsg = $Button1 then $5 = MsgBox(0,"manco",GUICtrlRead($n1)) EndIf Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Hello() MsgBox(0,$5,$5) EndFunc Well, what I basically want is to write a number or a name in a input on the GUI, and with that data, to work with it on a function (in this example, within a MsgBox command. How can I declare the variable in the function? Please helpp! thanks Link to comment Share on other sites More sharing options...
JohnOne Posted February 4, 2011 Share Posted February 4, 2011 expandcollapse popupHOTKEYSET("{F5}", "parar") Func PARAR() Exit 0 EndFunc ;_Hello() #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 126) $n1 = GUICtrlCreateInput("", 40, 24, 145, 21) GUICtrlSetBkColor(-1, 0xFFFFFF) $Button1 = GUICtrlCreateButton("Read", 88, 64, 97, 57) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() if $nMsg = $Button1 then $n2 = GUICtrlRead($n1) $5 = MsgBox(0,"manco",GUICtrlRead($n1)) EndIf Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Hello() MsgBox(0,$5,$5) EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jvanegmond Posted February 4, 2011 Share Posted February 4, 2011 Not sure what you mean here, but I will take another attempt: expandcollapse popupHOTKEYSET("{F5}", "parar") Func PARAR() Exit 0 EndFunc _Hello(123) #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 126) $n1 = GUICtrlCreateInput("", 40, 24, 145, 21) $n2 = GUICtrlRead($n1) GUICtrlSetBkColor(-1, 0xFFFFFF) $Button1 = GUICtrlCreateButton("Read", 88, 64, 97, 57) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() if $nMsg = $Button1 then $5 = GUICtrlRead($n1) _Hello($5) EndIf Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Hello($a) MsgBox(0,$a,$a) EndFunc github.com/jvanegmond 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