jimg Posted February 5 Share Posted February 5 Extrapolating what's in the help file, I would expect this to work, but is says "syntax error". local $var[5,5,7] $var[0,0] = [1,2,3,4,5,6,7] $var[0,1]= [7,6,5,4,3,2,1] etc. My $var array is loaded once, so I suppose I could read a file or something, but the above seemed so straightforward. BTW, this doesn't work either, which is a nearly direct quote from help: $local $days[7] $days = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"] but this does, so maybe my help file is out-of-date? local $days[7] = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"] Link to comment Share on other sites More sharing options...
water Posted February 5 Share Posted February 5 (edited) You define $var as a 1D array but you specify 2 dimensions on your assignment statements. $local is wrong - remove the $ sign. Edited February 5 by water Updated to make my post correct 😃 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...
Nine Posted February 5 Share Posted February 5 In fact, if you want to declare a 3D array you need to use : Local $var[5][5][7] If you want to assign a value to a specific cell, you need to use : $var[0][1][5] = "A value" If you want to instantiate a 3D array, you would need to use : Local $var[5][5][7] = [[[1,2,3,4,5,1,2], [6,7,8,9,0,1,2]]] ; partly instantiated Obviously, you are mixing how to declare an array and how to instantiate it. Please review help file and wiki to better understand how arrays are functioning in AutoIt. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
jimg Posted February 5 Author Share Posted February 5 I clearly mistyped the $local example. I really hate to have a assignment string with 175 values. I guess I'll use a separate file for the data table. Link to comment Share on other sites More sharing options...
water Posted February 5 Share Posted February 5 To transform a string into an Array please have a look at function StringSplit. 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...
jimg Posted February 5 Author Share Posted February 5 Thanks. I've moved on to an external data file and stringsplit. 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