Jump to content

Redim 2D Array


Recommended Posts

is it possible to redim 2d array ?

ReDim $Array[1][2]

$Array[ubound($Array)-1] = [ 1 , "Test"]

ReDim $Array[1][2]

$Array[ubound($Array)-1] = [ 2 , "Test2"]

_ArrayDisplay($Array)

I wanted to add new item into 2d array

Edited by victor
Link to comment
Share on other sites

Here my version:

#include <Array.au3>

Global $aTest[1][2] = [[1, "Test"]]
_ArrayDisplay($aTest)
ReDim $aTest[UBound($aTest) + 1][2]
$aTest[UBound($aTest) - 1][0] =  2
$aTest[UBound($aTest) - 1][1] = "Test"
_ArrayDisplay($aTest)

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

  • 5 years later...

Hi guys,

i have the same issue and i didn't understand how to redim my 2D Array.

First i try to redim the row and then the column.

 

Func FileSearch($sStringToSearch)
    $k=0
    For $i = 0 To UBound($content_array) - 1
            $search_result=StringInStr($content_array[$i],$sStringToSearch)
                If $search_result<>0  Then
                    ReDim $SearchOnlineActivation[$i + 1][$k]
                    For $k=0 To 25
                        ReDim $SearchOnlineActivation[$i][$k +1]
                        $SearchOnlineActivation [$i][$k] = $content_array[$i]
                        $k+=1
                        _ArrayDisplay($SearchOnlineActivation)
                        Next
                EndIf
    Next
EndFunc

Can anyone help me?

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...