Orca Posted June 23, 2005 Share Posted June 23, 2005 Okay so comming from PHP I'm used to named indexes and polydimensional arrays. $cfg['proflile']['dateFormat'] = dd: mm: yy That sort of thing, you also don't need to declare the number of slots per dim. It would dynamicly expand. The issue I'm having is I don't want to assign more space then is required. DIM $DATA[8] Declares variable DATA[0] through DATA[7]; DIM $DATA[8][3] Declares variable DATA[0][0]-[2] through DATA[8][0]-[2] Now in my case DATA[4][n] requires 16 locations for data but was granted only 3. How can I specify how many second level diminesions my arrays have? DIM $DATA[8] DIM $DATA[0][3] DIM $DATA[1][16] DIM $DATA[2][5] Or do I just register the maximum I would need for any one slot and leave most of them blank? No mater how much of a waste of resources it is. I AM ORCA!! A VERY POWERFUL WHALE!!! Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted June 24, 2005 Share Posted June 24, 2005 Redim as needed. Remember, when you resize an array, you need to add '1' to each dimension in the array else you will get errors Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
blindwig Posted June 24, 2005 Share Posted June 24, 2005 AutoIt does not have hashes built in, but see these threads for UDFs:http://www.autoitscript.com/forum/index.ph...topic=11611&hl=And no, you cannot have polydimensional arrays. Either dim the entire array to your maximum 2nd dimension, or make your own polidimensional handler, using an [x][2] array, where the 2nd column is a delimited string. My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
blindwig Posted June 24, 2005 Share Posted June 24, 2005 Here's something I just discovered: An array element can contain another array! Dim $ArrayMain[8], $i For $i = 0 to UBound($ArrayMain) - 1 dim $aTemp[$i + 1] $ArrayMain[$i] = $aTemp Next $aTemp = $ArrayMain[3] msgbox(0,IsArray($aTemp),UBound($aTemp)) Neat! My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions 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