SlackerAl Posted January 29, 2019 Posted January 29, 2019 I appreciate this seems like a trivial question, but my searching has failed.... I was using a 1D array as follows: Local $DataName[3] = [2, $sBaseFileName, $sUpdatedFileName] And all was OK. I then wanted to separate the declaration from the assignment and assumed I could do something like: Local $DataName[3] $DataName = [2, $sBaseFileName, $sUpdatedFileName] ;or $DataName[] = [2, $sBaseFileName, $sUpdatedFileName] But I see I cannot. I am aware that I can add the 3 elements 1 at a time with _ArrayAdd, but is there a simple inline method like I was trying for? Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.
Nine Posted January 29, 2019 Posted January 29, 2019 You could do $DataName = StringSplit ("2," & $sBaseFileName & "," & $sUpdatedFileName, ",", $STR_NOCOUNT) “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Subz Posted January 29, 2019 Posted January 29, 2019 You can add multiple lines using _ArrayAdd Local $DataName[0] _ArrayAdd($DataName, "2|" & $sBaseFileName & "|" & $sUpdatedFileName) SlackerAl 1
SlackerAl Posted January 30, 2019 Author Posted January 30, 2019 (edited) Thanks Subz. Ugly, but effective.... Edit: My bad, ignore the old edit. Edited January 30, 2019 by SlackerAl Error noted. Problem solving step 1: Write a simple, self-contained, running, replicator of your problem.
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