ThomasQ Posted March 22, 2010 Share Posted March 22, 2010 Hi! I got two arrays containting information wich are linked to eacht other(position 1 in array 1 contains information about position 1 in array 2, and I'm getting really frustrated of constantly accessing 2 different arrays. How do I combine the two (2d) arrays, into 1 3d array? And how do I acces this array with functions like _arrayToString? Much Obliged, and thanks in advance! Thomas Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 22, 2010 Moderators Share Posted March 22, 2010 ThomasQ, I am sure something can be done to combine your data, but could you please give us an idea of what exactly the arrays look like and how they inter-relate. If you could provide an idea of what you want as a final result that would also be extremely useful. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ThomasQ Posted March 22, 2010 Author Share Posted March 22, 2010 (edited) Thanks! The script I'm making has to do with Sport results. The raw data is being read from our website with _IEBodyReadText, and then sorted with String Explode. Then I use Array Find All to find the entries containing Outcomes, and I use Array Find All to find all the entries containing Dates. So I end up with 2 arrays containing the positions of the info I want from the main array. These positions are linked -> array 1, position 1, is the outcome of the match played on the date in array 2 position 1. To make my scripting live easier, I would like to make a 3d array containg the outcome in the first column, and the date in the 2nd column. So I need a way to make the 3d array, and then fill it accordingly.. Thanks in advance PS the main array is full of other data i can't use, and using the Array Find All function is the fastest way to sort it out. The two different 2d arrays are therefore needed. Edited March 22, 2010 by ThomasQ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 22, 2010 Moderators Share Posted March 22, 2010 ThomasQ, I would like to make a 3d array containg the outcome in the first column, and the date in the 2nd columnI do not think you want a 3D array, I think you want a 2D array with a number of columns. If I understand you correctly, you have 2 arrays like this: Index Array 1 Array 2 0 Date of match 1 Outcome of Match 1 1 Date of match 2 Outcome of Match 2 2 Date of match 3 Outcome of Match 3 3 Date of match 4 Outcome of Match 4 To combine the arrays, you need to do something like this: #include <Array.au3> Global $aDates[4] = ["Date 1", "Date 2", "Date 3", "Date 4"] $iSize = UBound($aDates) Global $aOutcomes[4] = ["Outcome 1", "Outcome 2", "Outcome 3", "Outcome 4"] Global $aCombined[$iSize][2] If $iSize <> UBound($aOutcomes) Then MsgBox(0, "Error", "Arrays are mismatched") For $i = 0 To $iSize - 1 $aCombined[$i][0] = $aDates[$i] $aCombined[$i][1] = $aOutcomes[$i] Next _ArrayDisplay($aCombined) I hope this helps. If I have misuderstood or if this is not quite right, please ask again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ThomasQ Posted March 25, 2010 Author Share Posted March 25, 2010 Thanks a lot!! I'm using it now, works like a charm!! Link to comment Share on other sites More sharing options...
imbrija Posted December 14, 2011 Share Posted December 14, 2011 Thanks! I was looking for this long long time 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