Sign in to follow this  
Followers 0
LondonNDIB

clearing an array

4 posts in this topic

I'm sure there's a simple answer to this... but with this site's search feature i'm getting nowhere so I guess I should just ask.

How do you clear an array?

I'm calling a function that uses IniReadSection. IniReadSection reads in a section of an INI file and keeps the key/data pairs in a 2 dimensional array.

I call the function several times and I want to overwrite the array, but instead it keeps adding on to it (so I end up with duplicates, triplicates, etc)

I thought all I needed to do was pass some sort of $variable = "" command in at the beginning of the function but that doesn't seem to work.

Thoughs?

Thanks.

LD

Share this post


Link to post
Share on other sites



Would the function _ArrayDelete be suitable?


CheersNobby

Share this post


Link to post
Share on other sites

actually no, because that does it one element at a time...

but.... I just found out that I was incorrect on the problem. Re-calling the IniReadSection function *DOES* over-write the array.

As it turns out, the problem wasn't the array itself - it was in my GUI. I was feeding the results of the IniReadSection function to a ListBox and THAT was being called twice and was doubling up on the elements.

So - Problem solved and it has nothign to do with the topic title :lmao:

Thank you and sorry for wasting your time.

LD

Share this post


Link to post
Share on other sites

actually no, because that does it one element at a time...

but.... I just found out that I was incorrect on the problem. Re-calling the IniReadSection function *DOES* over-write the array.

As it turns out, the problem wasn't the array itself - it was in my GUI. I was feeding the results of the IniReadSection function to a ListBox and THAT was being called twice and was doubling up on the elements.

So - Problem solved and it has nothign to do with the topic title :lmao:

Thank you and sorry for wasting your time.

LD

no waste man, i'm glad you figured it out, but we're here to help man. and your post may help someone else down the line

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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