Jump to content
Sign in to follow this  
lsakizada

How to erase content of two dimentinal aray

Recommended Posts

lsakizada

Yes it is me again, I am working all night to create for my boss script that supposed to be finished as for this morning ...:)

I have two dim array that populated many times with data. I need to erase it each time it populated with new serios of data.

According to the document it should be set to zero. but it is not working for me.

Global $aBSCData[2][12]

I am erasing it this way:

aBSCData=0

What's wrong with that?


Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites
lsakizada

_ArrayDelete() Dosn't work?

No, it is done for single dimmension


Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites
Kerros

I tried this, and it seemed to work in my case.

#include<array.au3>
global $aBSCData[2][12]
for $icc = 1 to 11
$aBSCData[0][$icc] = $icc
$aBSCData[1][$icc] = $icc
next
_ArrayDisplay($aBSCData)
$aBSCData= 0
MsgBox(0,"",$aBSCData)
_ArrayDisplay($aBSCData);<===Will not display if $aBSCData is not an array

It isn't by chance that you are missing the $ in front of $aBSCData= 0


Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Share this post


Link to post
Share on other sites
lsakizada

It is delete the array but not erase the content.

It isn't by chance that you are missing the $ in front of $aBSCData= 0

No, it is paste problem.

Edited by lsakizada

Be Green Now or Never (BGNN)!

Share this post


Link to post
Share on other sites
weaponx

Look at this example:

Dim $array[1] = ["TEST"]

$array[0] = "Change element"

ConsoleWrite("Element 0: " & $array[0] & @CRLF)

Dim $array[1]

ConsoleWrite("Element 0: " & $array[0])

Redim is nondestructive if you are increasing the size of the array.

Dim will destroy the array, regardless of how many dimensions there are.

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  

×