Jump to content
victor

Redim 2D Array

Recommended Posts

victor

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

Share this post


Link to post
Share on other sites
UEZ

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
LoneWolf_2106

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?

 

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

×