Jump to content

Recommended Posts

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

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

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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...