Tiggerstrigger Posted October 14, 2016 Share Posted October 14, 2016 I want to create an multiple arrays using a for loop but i am unsure how to do that. I would like to do something like this. For $i = 0 To 10 Step 1 local $array & $i [$i] Next but i am not sure how to work around the sytax thanks for the help. Link to comment Share on other sites More sharing options...
water Posted October 14, 2016 Share Posted October 14, 2016 Welcome to AutoIt and the forum! Can you please tell us why you need to dynamically create arrays? I never had the need to create arrays this way and I'm sure it can become quite complex. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Muhammad_Awais_Sharif Posted October 14, 2016 Share Posted October 14, 2016 may be you are looking for this #include <Array.au3> Local $aArray[1] _ArrayAdd($aArray, "one thing") _ArrayAdd($aArray, "another thing") _ArrayAdd($aArray, "another thing") For $i = 1 To 20 _ArrayAdd($aArray, $i) Next For $i = 0 To UBound($aArray)-1 ConsoleWrite($aArray[$i] & @CRLF) Next https://www.autoitscript.com/autoit3/docs/libfunctions/_ArrayAdd.htm Link to comment Share on other sites More sharing options...
Tiggerstrigger Posted October 14, 2016 Author Share Posted October 14, 2016 Thanks. sure, i am reading multiple text files with hardware information one at a time and saving manipulated data (simple strings) to an array. I want to create an overview about the number of machines that are using a specific hardware element and the number of machines that are using a similar/ the same hardware configuration while saving which machine has what by saving the ip addresses corresponding to the machines and their hardware configuration. the data in the Textfile can look like this (file Attached) I am not very experienced at all this is my second thing that i am doing ^^ I am very happy to find out easier,better or just alternativ ways to archiving my goal. My thinking was cycling through the files with a loop and reading the hardware information in an array, $aCurrentHardwareConfig[Category like Motherboard] [Specific Part saved as the string behind :] ( this Array will then compare itself with $aOverviewHardwareConfig wich saves the added up strings from Specific Parts, a counter and the added up Ip Adresses of the machines that got true when comparing the added up string of hardware. If it gets false it wil create a new array entry with his added up hardware from $aCurrentHardwareConfig and add the ip address saved in the .txt . I also wanted to Save the number of machines with a spefic hardware part. Thats why i wanted to create one Array for each category so i can just save the Diffrent hardware parts in an array with a counter and add one if a new graphics card gets discovered. That would mean i need to creat an Array for every category but the categories arent fixed. That was probably to much information. Its hard to gague whats important for another person... Thanks for the interest. Hardwareinfo.txt Link to comment Share on other sites More sharing options...
water Posted October 14, 2016 Share Posted October 14, 2016 Quote That would mean i need to creat an Array for every category but the categories arent fixed. I would create a single array for this with the first column holding the category. I think this makes the handling much easier compared to handle a growing number of arrays. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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