[RESOLVED] Filling and Killing an Array
I have a loop which is grabbing information from a txt file. The amount of content that is sucked out varies each time.
What I need to do is somehow add this content from the loop into an array without knowing how much data is already in the array, so Im guessing maybe use the .Count function?
Also, I need to know how to empty the entire array, do I have to do a loop to zero out all the slots or can I do it all in one function call?
Cheers :)
Re: Filling and Killing an Array
You can use Redim Preserve and redeclare your array to a size of one element greater while preserving your values, OR, you could see whether your file's values can simply be .Split() into the array you've declared.
Re: Filling and Killing an Array
OK, and how about removing all data from it? :)
Re: Filling and Killing an Array
Just a "redim" should do.
Re: Filling and Killing an Array
Also, look at the Array.Clear() method.
Re: Filling and Killing an Array
Re: Filling and Killing an Array
Re: Filling and Killing an Array
Quote:
Originally Posted by Cyber-Drugs
OK, and how about removing all data from it? :)
array has clear method.
dim s() as string
s.clear()
Re: Filling and Killing an Array
result of slow connection :(
Re: Filling and Killing an Array
see the Erase statement also, I cant remember what it does exactly:D
Re: Filling and Killing an Array
Quote:
Originally Posted by MrPolite
see the Erase statement also, I cant remember what it does exactly:D
It establishes an internet connection, downloads 10 gigabytes of Baywatch wallpaper and launches WMP with 6 hours of David Hasselhoff's greatest hits, and you can't turn it off!
Erase is bad.
Re: [RESOLVED] Filling and Killing an Array
*avoids erase like the plague*
:|