LondonNDIB Posted January 12, 2006 Share Posted January 12, 2006 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 comment Share on other sites More sharing options...
nobby Posted January 12, 2006 Share Posted January 12, 2006 Would the function _ArrayDelete be suitable? CheersNobby Link to comment Share on other sites More sharing options...
LondonNDIB Posted January 12, 2006 Author Share Posted January 12, 2006 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 Thank you and sorry for wasting your time. LD Link to comment Share on other sites More sharing options...
seandisanti Posted January 12, 2006 Share Posted January 12, 2006 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 Thank you and sorry for wasting your time.LDno 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 comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now