Jump to content
Sign in to follow this  
PCode

Another question about Multidim Arrays

Recommended Posts

PCode

It is possible to have arrays of arrays where where the secondary arrays have different sizes?

Right now I've had to ReDim so that my secondary arrays are all as big as the biggest secondary array.

Therefore, I have to use the 0th element of each secondary array to store the amount of elements actually being used by the array.

This means that if I were to have one secondary array the size of 100, and two others the size of 50, I'd have 100 extra variables just wasting memory.

Is there anyway around this?

Share this post


Link to post
Share on other sites
weaponx

You can nest arrays.

Dim $SubArray[3] = ["A","B",C"]
Dim $Array[1]

$Array[0] = $SubArray

$TempArray = $Array[0]

For $X = 0 to Ubound($TempArray)-1
ConsoleWrite($TempArray[$X] & @CRLF)
Next

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.