goldenix Posted May 11, 2008 Posted May 11, 2008 (edited) Can someone explain why can i I get the text from inputboxes? see Func Button1()I want to loop through inputboxes & get the data. Seems like my variable is not understood by autoit#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 322, 178, 193, 115) $Input1 = GUICtrlCreateInput("Input1", 24, 24, 113, 21) $Input2 = GUICtrlCreateInput("Input2", 24, 56, 113, 21) $Button1 = GUICtrlCreateButton("Button1", 176, 32, 65, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### ; events GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlSetOnEvent($Button1, "Button1") Func Button1() for $a = 1 to 2 ; check inputbox 1 & 2 ;~ if guictrlread($input & $a) = "" then MsgBox(0,'ALERT','Inputbox' & $a & ' is Empty!') MsgBox(0,'',GuiCtrlRead('$Input' & $a)) Next EndFunc Func CLOSEClicked() Exit EndFunc While 1 Sleep(1000) ; Idle around WEnd Edited May 11, 2008 by goldenix My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
monoceres Posted May 11, 2008 Posted May 11, 2008 (edited) GUICtrlRead does not take a string as a variable, it takes the control id you got returned from GUICtrlCreate..., if you want to loop though the inputs save the control id's in an array and loop through the array. Edited May 11, 2008 by monoceres Broken link? PM me and I'll send you the file!
nfwu Posted May 11, 2008 Posted May 11, 2008 Spoonfeeding time! Do it like this: Func Button1() MsgBox(0,'',GuiCtrlRead($Input1)) MsgBox(0,'',GuiCtrlRead($Input2)) EndFunc Eval takes the name of the variable as a string and returns the value of that variable. You *cannot* use a string as a variable name directly, like you intended to do. TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
goldenix Posted May 11, 2008 Author Posted May 11, 2008 nfwu said: Do it like this: MsgBox(0, '', Eval("Input"&$i)) And thanx Btw. My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
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