Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Parsing/converting array!

$
0
0

I have had total brain block on this for almost a week, I simply cannot get my head around the logic.

 

Asking if someone else can.

 

It does not look like a difficult problem, but I'm simply psychoblocked on the matter.

 

Bigger issue, which boils down to creating one array from another.

 

The two arrays below are what I start with and what I need to get to programmatically.

 

I'm seriously, usually fine and unafraid of arrays and this sort of logic, and don't understand why I'm suffering this mental block.

 

Please help a man in distress.

AutoIt         
#include <Array.au3> ; In the following array, you see that Type1 one has 3 SubTypes, ; Subtype1, Subtype2, and Subtype3. ; ; Type 2 has 2 subtypes, type3, only 1 etc... ; ; Of course this is not fixed size array and the anount of subtypes vary ; The array is sorted by type though Global $aFirstArray[10][2] = [["Type1", "Subtype1"],["Type1", "Subtype2"], _         ["Type1", "Subtype3"],["Type2", "Subtype4"], _         ["Type2", "Subtype5"],["Type3", "Subtype5"], _         ["Type4", "Subtype6"],["Type4", "Subtype7"], _         ["Type5", "Subtype8"],["Type5", "Subtype9"]] _ArrayDisplay($aFirstArray, "This") ; This is the desired output array ; Like a Parent(Type) header, then Children (Subtypes) bel;ow it Global $aSecondArray[15] = ["Type1", "Subtype1", "Subtype2", "Subtype3", _         "Type2", "Subtype4", "Subtype5", _         "Type3", "Subtype5", _         "Type4", "Subtype6", "Subtype7", _         "Type5", "Subtype8", "Subtype9"] _ArrayDisplay($aSecondArray, "To This")

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>