Sign in to follow this  
Followers 0
Sypher

Arrays in Arrays

5 posts in this topic

#1 ·  Posted (edited)

Hi Folks,

I am working on a little tool that automates some of the tasks i normally have to do by hand.

The big problem is that i'm stuck at creating multidimensional arrays.

Dim $ResultArrayoÝ÷ Ù«­¢+Ù}ÉÉå%¹ÍÉÐ ÀÌØíIÍÕ±ÑÉÉä°À°}ÉÉå
ÉÑ ÀÌØí±¥¹°ÀÌØí±¥¹¬°=ÙÉÉÕ±È ÀÌØí±¥¹¤¤¤

The results of that is the following (made with _ArrayDisplayTree)

Posted Image

It just crashes... I've tried lots of various code, but this is just pretty annoying :)

The Array is created from within a for-loop that reads the RSS feed, and the data i like are being put in the array.

The thing i am trying to do - but well, without $ResultArray[1][0] i can't do much - is to cross-match the array content with another array, and dump all the non-matching ones (think: watchlist).

Anyhow, can anyone please point me in the good direction? Thanks!

Edited by Sypher

Share this post


Link to post
Share on other sites



I think taking a look at ReDim could solve alot of your problems :)

Dim $array[6]

Msgbox(0,"1D","The array is: " &Ubound($array,0)&" dimension."

ReDim $Array[6][6]

Msgbox(0,"2D","The array is: " &Ubound($array,0)&" dimensions."

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi,

consider Array2d in my sig?

eg

; arrayexampleinsert.au3
#include<array2D.au3>
local $ar_Created2D[1][1],$asControls = StringSplit(WinGetClassList("", ""), @LF)
_ArrayDisplay($asControls,"$asControls")
local $arGrid[2][4] = [["Paul", "Jim", "Richard", "Louis"], [485.44, 160.68, 275.16, 320.00]]
_ArrayDisplay($arGrid,"$arGrid")
local $arGrid0[4] = ["Paul", "Jim", "Richard", "Louis"]
_ArrayDisplay($arGrid0,"$arGrid0")
local $arGrid1[4] = [485.44, 160.68, 275.16, 320.00]
_ArrayDisplay($arGrid1,"$arGrid1")
_ArrayInsert2D( $ar_Created2D, $arGrid0, 0)
_ArrayInsert2D( $ar_Created2D, $arGrid1, 0)
_ArrayDisplay($ar_Created2D,"$ar_Created2D")
Best, randall Edited by randallc

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Or even...

; arrayexampleinsert.au3
#include<array2D.au3>
local $ar_Created2D[1][1],$arGrid0[4] = ["Paul", "Jim", "Richard", "Louis"]
local $arGrid1[4] = [485.44, 160.68, 275.16, 320.00]
local $arGrid2[4] = [1,2 ,3, 4]
for $a=0 to 1
_ArrayInsert2D( $ar_Created2D, eval("arGrid"&$a), 0)
_ArrayInsert2D( $ar_Created2D, eval("arGrid"&$a), 0)
next
_ArrayInsert2D( $ar_Created2D, $arGrid2, 2)
_ArrayDisplay($ar_Created2D,"$ar_Created2D")
Randall Edited by randallc

Share this post


Link to post
Share on other sites

Thanks, the array2D inserting seems to be working

$tempArr = _ArrayCreate($line, $link, Overruler($line))
        _ArrayInsert2D ($ar_Created2D, $tempArr, 0)

So Thanks! Now i can finally use $array[$x][1] etc :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0