RacecarSoft Posted November 26, 2008 Posted November 26, 2008 I want to make a text box that pops up and asks what they want to be in the variable. I tried this (oh and btw credit to the autoit examples because this is a copy off of some of it): CODE: Example() Func Example() Local $myedit, $msg, $TYPEME $var = "foo" GUICreate("My GUI edit") ; will create a dialog box that when displayed is centered $myedit = GUICtrlCreateEdit("" & $var & @CRLF, 176, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL) GUISetState() Send("{END}") ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() MsgBox(64, $var, "test to see if the change worked") EndFunc ;==>Example END CODE But when I modify the text box, it reverts the variable to "foo" again, how do I make the text box actually EDIT it rather than ignoring the changes? Please help! Racecar 56 [s]Visit My Website[/s] (this isn't up 24/7). (SITE DOWN) This is now a HP MediaSmart site, I'm trying to get my server working the way I want it to.24/7 site (make sure you have noscript, sorry!): 24/7 [u]WARNING: MUST have NoScript so you can block quantserve/quantcast![/u] If you don't, the evil freewebs/webs/quantcast/quantserve/WHATEVER virus will get you![spoiler]Hey, look! It's a spoiler![/spoiler]Software: KeyPress, Advanced Calculator (not autoit), WUK (Windows Update Killer)my account over a year old : >... I do Linux.
skysel Posted November 26, 2008 Posted November 26, 2008 $input = InputBox("Window title", "Enter your variable:") MsgBox(0,"User input is..",$input)
Zedna Posted November 26, 2008 Posted November 26, 2008 (edited) Example() Func Example() Local $myedit, $msg, $TYPEME $var = "foo" GUICreate("My GUI edit"); will create a dialog box that when displayed is centered $myedit = GUICtrlCreateEdit("" & $var & @CRLF, 176, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL) GUISetState() Send("{END}") ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd $var = GUICtrlRead($myedit) GUIDelete() MsgBox(64, $var, "test to see if the change worked") EndFunc;==>Example Edited November 26, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
RacecarSoft Posted November 26, 2008 Author Posted November 26, 2008 (edited) Example() Func Example() Local $myedit, $msg, $TYPEME $var = "foo" GUICreate("My GUI edit"); will create a dialog box that when displayed is centered $myedit = GUICtrlCreateEdit("" & $var & @CRLF, 176, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL) GUISetState() Send("{END}") ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd $var = GUICtrlRead($myedit) GUIDelete() MsgBox(64, $var, "test to see if the change worked") EndFunc;==>Example Thanks alot! EDIT: Oh shoot! It puts 1's after it types! Here is the full code (to see if any of you out there can improve it ) : CODE #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: Racecar56 Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here ;----------==Includes==---------- #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> ;----------==Options==----------- Opt('MustDeclareVars', 1) ;----------==Local==------------- Local $var ;----------==Script==------------ Global $oMyError Example() Func Example() Local $myedit, $msg, $TYPEME $var = "foo" GUICreate("My GUI edit"); will create a dialog box that when displayed is centered $myedit = GUICtrlCreateEdit("" & $var & @CRLF, 176, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL) GUISetState() Send("{END}") ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd $var = GUICtrlRead($myedit) GUIDelete() MsgBox(64, $var, "test to see if the change worked") EndFunc;==>Example Local $i $i = 0 While $i <= 0 $var = Send( $var ) Sleep(05) WEnd END OF CODE Edited November 26, 2008 by RacecarSoft [s]Visit My Website[/s] (this isn't up 24/7). (SITE DOWN) This is now a HP MediaSmart site, I'm trying to get my server working the way I want it to.24/7 site (make sure you have noscript, sorry!): 24/7 [u]WARNING: MUST have NoScript so you can block quantserve/quantcast![/u] If you don't, the evil freewebs/webs/quantcast/quantserve/WHATEVER virus will get you![spoiler]Hey, look! It's a spoiler![/spoiler]Software: KeyPress, Advanced Calculator (not autoit), WUK (Windows Update Killer)my account over a year old : >... I do Linux.
RacecarSoft Posted November 26, 2008 Author Posted November 26, 2008 Thanks alot! EDIT: Oh shoot! It puts 1's after it types! Here is the full code (to see if any of you out there can improve it ) :CODE#cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: Racecar56 Script Function: Template AutoIt script.#ce ----------------------------------------------------------------------------; Script Start - Add your code below here;----------==Includes==----------#include <GUIConstantsEx.au3>#include <WindowsConstants.au3>#include <EditConstants.au3>#include <StaticConstants.au3>;----------==Options==-----------Opt('MustDeclareVars', 1);----------==Local==-------------Local $var;----------==Script==------------Global $oMyErrorExample()Func Example()Local $myedit, $msg, $TYPEME$var = "foo"GUICreate("My GUI edit"); will create a dialog box that when displayed is centered$myedit = GUICtrlCreateEdit("" & $var & @CRLF, 176, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL)GUISetState()Send("{END}"); Run the GUI until the dialog is closedWhile 1$msg = GUIGetMsg()If $msg = $GUI_EVENT_CLOSE Then ExitLoopWEnd$var = GUICtrlRead($myedit)GUIDelete()MsgBox(64, $var, "test to see if the change worked")EndFunc;==>ExampleLocal $i$i = 0While $i <= 0 $var = Send( $var ) Sleep(05)WEndEND OF CODEAnybody there? (sorry for dubble post) [s]Visit My Website[/s] (this isn't up 24/7). (SITE DOWN) This is now a HP MediaSmart site, I'm trying to get my server working the way I want it to.24/7 site (make sure you have noscript, sorry!): 24/7 [u]WARNING: MUST have NoScript so you can block quantserve/quantcast![/u] If you don't, the evil freewebs/webs/quantcast/quantserve/WHATEVER virus will get you![spoiler]Hey, look! It's a spoiler![/spoiler]Software: KeyPress, Advanced Calculator (not autoit), WUK (Windows Update Killer)my account over a year old : >... I do Linux.
BrettF Posted November 26, 2008 Posted November 26, 2008 Please wait 24 hours before bumping your post. You might want to look here specifically. Local $i $i = 0 While $i <= 0 $var = Send( $var ) Sleep(05) WEnd You reset $var to be the return value of send.... Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
RacecarSoft Posted November 26, 2008 Author Posted November 26, 2008 Please wait 24 hours before bumping your post.You might want to look here specifically.Local $i$i = 0While $i <= 0$var = Send( $var )Sleep(05)WEndYou reset $var to be the return value of send.... Cheers,BrettOh, thanks! [s]Visit My Website[/s] (this isn't up 24/7). (SITE DOWN) This is now a HP MediaSmart site, I'm trying to get my server working the way I want it to.24/7 site (make sure you have noscript, sorry!): 24/7 [u]WARNING: MUST have NoScript so you can block quantserve/quantcast![/u] If you don't, the evil freewebs/webs/quantcast/quantserve/WHATEVER virus will get you![spoiler]Hey, look! It's a spoiler![/spoiler]Software: KeyPress, Advanced Calculator (not autoit), WUK (Windows Update Killer)my account over a year old : >... I do Linux.
Zedna Posted November 26, 2008 Posted November 26, 2008 Also use Send( $var, 1 ) In this case your text could contain also special characters like !,+,^,# without interpreting them as special characters (raw mode). Resources UDF ResourcesEx UDF AutoIt Forum Search
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