ToastyScripter Posted August 27, 2019 Posted August 27, 2019 (edited) expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <Array.au3> Dim $InputArray[6] #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Solid Edge Part Search", 301, 201, -769, 130) $inputArray[0] = GUICtrlCreateInput("", 16, 8, 90, 21) $inputArray[1] = GUICtrlCreateInput("", 16, 40, 90, 21) $inputArray[2] = GUICtrlCreateInput("", 16, 72, 90, 21) $inputArray[3] = GUICtrlCreateInput("", 16, 104, 90, 21) $inputArray[4] = GUICtrlCreateInput("", 16, 136, 90, 21) $inputArray[5] = GUICtrlCreateInput("", 16, 168, 90, 21) $Radio1 = GUICtrlCreateRadio("DFT Search", 128, 48, 89, 17) GUICtrlSetState(-1, $GUI_CHECKED) $Radio2 = GUICtrlCreateRadio("PAR Search", 128, 80, 89, 17) $Radio3 = GUICtrlCreateRadio("ASM Search", 128, 112, 89, 17) $Button1 = GUICtrlCreateButton("Open Files", 216, 40, 75, 25) $Button2 = GUICtrlCreateButton("Open Folders", 216, 72, 75, 25) $Button3 = GUICtrlCreateButton("Test", 216, 104, 75, 25) GUISetState() #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $inputArray[0] Case $inputArray[1] Case $inputArray[2] Case $inputArray[3] Case $inputArray[4] Case $inputArray[5] Case $Radio1 Case $Radio2 Case $Radio3 Case $Button1 Case $Button2 Case $Button3 Run(Test()) EndSwitch WEnd Func Math() EndFunc Func Ext() Global $Type = "" If GUICtrlRead($Radio1) = 1 Then Global $Type = ".DFT" Endif If GUICtrlRead($Radio2) = 1 Then Global $Type = ".PAR" Endif If GUICtrlRead($Radio3) = 1 Then Global $Type = ".ASM" Endif ;MsgBox(4096, "Test", $type) EndFunc Func Clear() EndFunc Func Test() _ArrayDisplay($inputArray) EndFunc Im trying to make a file search/Opener for a bunch of draft files stored in a folder within a folder within a folder structure. for some reason i cant get my "InputArray[]"s don't send the input into the array. if i view the array using my "Test" button it just shows numbers from 3 to 8 in each Row instead of what data i entered. Am i missing something? Edited August 27, 2019 by ToastyScripter
BrewManNH Posted August 27, 2019 Posted August 27, 2019 4 minutes ago, ToastyScripter said: Am i missing something? Yes, GUICTRLRead is what you're missing. Look at the examples in the GUICTRLCreateInput, they all use that function to read the contents. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
ToastyScripter Posted August 27, 2019 Author Posted August 27, 2019 2 minutes ago, BrewManNH said: Yes, GUICTRLRead is what you're missing. Look at the examples in the GUICTRLCreateInput, they all use that function to read the contents. So Ive added a reading bit into my test function to read each input box but i still returns random numbers. Func Test() For $A to 5 GuiCtrlRead($inputArray[$A]) Next _ArrayDisplay($inputArray) EndFunc
BrewManNH Posted August 27, 2019 Posted August 27, 2019 Last time, open the help file, and read how to use GUICtrlRead with an input control. It's ALL in there, and you're completely missing the mark on this. Your For loop is written wrong, you're reading the contents of the Input control, but not using what you're reading, and your InputArray is not random numbers, it's the control id's of the input controls you created. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
Developers Jos Posted August 27, 2019 Developers Posted August 27, 2019 @ToastyScripter, I do not see anything wrong or untrue in the answer @BrewManNH gave so when you aren't prepared for an honest answer you better don't ask the question in stead of reporting it. Jos FrancescoDiMuro 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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