Sign in to follow this  
Followers 0
MrPook

help on creating a matrix

5 posts in this topic

Hello,

i'm using AutoIt and i need a way to have links between arrays.

Let me explain : i've got a liste of stuff and each stuff has a list of stuff associated.

I would like to navigate in this "tree" but the only way i figured out until now is creating a temp array for each first stuff.

The problem is that i dont know how many first stuff i'll have, therefore i cant build temp arrays.

Is there any solution to my prob ? (i saw help files but didnt find anything related, same with search option)

Thanks in advance.

Pook

Share this post


Link to post
Share on other sites



Hello,

i'm using AutoIt and i need a way to have links between arrays.

Let me explain : i've got a liste of stuff and each stuff has a list of stuff associated.

I would like to navigate in this "tree" but the only way i figured out until now is creating a temp array for each first stuff.

The problem is that i dont know how many first stuff i'll have, therefore i cant build temp arrays.

Is there any solution to my prob ? (i saw help files but didnt find anything related, same with search option)

Thanks in advance.

Pook

You need to provide more information. Multidimensional arrays (2D or 3D) might be an answer, or an "array-of-arrays", which can be dynamically sized by _ArrayAdd(), ReDim, etc.

Since you call them "list of stuff", does that mean a simple 1D array will hold the data, or is it a 2D row/column arrangement?

How many elements are you talking about -- tens, hundreds, thousands, tens-of-thousands?

Will the data be read from/stored to a file, or dynamically created and used in memory only at each run time?

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

You need to provide more information. Multidimensional arrays (2D or 3D) might be an answer, or an "array-of-arrays", which can be dynamically sized by _ArrayAdd(), ReDim, etc.

Since you call them "list of stuff", does that mean a simple 1D array will hold the data, or is it a 2D row/column arrangement?

How many elements are you talking about -- tens, hundreds, thousands, tens-of-thousands?

Will the data be read from/stored to a file, or dynamically created and used in memory only at each run time?

:whistle:

Sorry for the "light" question.

So here it is, it's a 2D array (matrix) like

Dim $toto[1][1]

i tried

_ArrayAdd($toto,$etatDef)

_ArrayAdd($toto,$etatDef)

_ArrayAdd($toto[1],$text)

_ArrayAdd($toto[2],$text1)

_ArrayDisplay ( $toto[1], "TMP")

_ArrayDisplay ( $toto, "TMP")

but it doesn't work.

In terms of size, it won't be more than 1000*1000, and will be stored in memory during the running of the program

Thanks.

Pook

Share this post


Link to post
Share on other sites

Sorry for the "light" question.

So here it is, it's a 2D array (matrix) like

Dim $toto[1][1]

i tried

_ArrayAdd($toto,$etatDef)

_ArrayAdd($toto,$etatDef)

_ArrayAdd($toto[1],$text)

_ArrayAdd($toto[2],$text1)

_ArrayDisplay ( $toto[1], "TMP")

_ArrayDisplay ( $toto, "TMP")

but it doesn't work.

In terms of size, it won't be more than 1000*1000, and will be stored in memory during the running of the program

Thanks.

Pook

That helps. _ArrayDisplay() and _ArraySort() have been updated to use 1D or 2D arrays, but sadly _ArrayAdd() has not.

It's not hard to roll your own with ReDim though, and it has been done to death in other forum topics.

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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