vrsrinivas2000 Posted April 24, 2017 Share Posted April 24, 2017 Hi, 1) How to declare 3d array with external excel table variables (3 dimensional table). 2) How to change the 2d to 3d array (Already used 2d array in the scrip) Link to comment Share on other sites More sharing options...
spudw2k Posted April 24, 2017 Share Posted April 24, 2017 According to the help file, you cannot resize the dimensions of an existing array and retain the data in it. Per the help file, Quote The ReDim keyword is similar to Global/Local, except that ReDim preserves the values in the array instead of removing the values while resizing an array.The number of dimensions must remain the same, or the old array will be forgotten during the ReDim.The array will retain the scope (Global or Local) that it had prior to resizing. So you'll probably have to create a new 3D array and populate as needed, or re-write your script to make the array 3D from the get go. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
czardas Posted April 24, 2017 Share Posted April 24, 2017 (edited) 4 hours ago, vrsrinivas2000 said: 2) How to change the 2d to 3d array (Already used 2d array in the scrip) You can do this using _PreDim() without any data loss. The function was designed for this very purpose. See ArrayWorkshop in my signature below. #include <ArrayWorkshop.au3> Local $aArrayXD = [[1,2],[3,4]] ; 2D array _PreDim($aArrayXD, 3) ; becomes a 3D array After this you can increase the size of the third dimension using (the more standard) ReDim. Alternatively, you can attach 2D arrays in the 3rd dimension using _ArrayAttach(): think of this as stacking spread sheets in a pile. Edited April 24, 2017 by czardas Xandy 1 operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 24, 2017 Moderators Share Posted April 24, 2017 Moved to the appropriate forum, as the DEV forum specifically states: Quote Do not create AutoIt-related topics here "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
jguinch Posted April 24, 2017 Share Posted April 24, 2017 Are you sure that your array is a 3D array ? What kind of Excel table is it ? I think it's a 2 columns to 3 columns redimension , no ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
czardas Posted April 24, 2017 Share Posted April 24, 2017 (edited) Yeah, I wondered about that. It shows how little I use Excel. It should have 3D grids though, and you should be able to zoom into the matrix using the mouse wheel. Edited April 24, 2017 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
kylomas Posted April 24, 2017 Share Posted April 24, 2017 28 minutes ago, czardas said: Yeah, I wondered about that. It shows how little I use Excel. It should have 3D grids though, and you should be able to zoom into the matrix using the mouse wheel. Beam me up, Scotty! Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
czardas Posted April 25, 2017 Share Posted April 25, 2017 (edited) It just seems like an obvious way to organize certain types of data. Edited April 25, 2017 by czardas operator64 ArrayWorkshop 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