|
-
Jul 20th, 2005, 03:49 AM
#1
Thread Starter
Lively Member
[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
-
Jul 20th, 2005, 03:55 AM
#2
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.
-
Jul 20th, 2005, 03:57 AM
#3
Thread Starter
Lively Member
Re: Filling and Killing an Array
OK, and how about removing all data from it?
-
Jul 20th, 2005, 04:01 AM
#4
Re: Filling and Killing an Array
Just a "redim" should do.
-
Jul 20th, 2005, 04:02 AM
#5
Re: Filling and Killing an Array
Also, look at the Array.Clear() method.
-
Jul 20th, 2005, 04:03 AM
#6
Re: Filling and Killing an Array
I don't live here any more.
-
Jul 20th, 2005, 04:03 AM
#7
Re: Filling and Killing an Array
I don't live here any more.
-
Jul 20th, 2005, 04:04 AM
#8
Re: Filling and Killing an Array
 Originally Posted by Cyber-Drugs
OK, and how about removing all data from it? 
array has clear method.
dim s() as string
s.clear()
-
Jul 20th, 2005, 04:05 AM
#9
Re: Filling and Killing an Array
result of slow connection
-
Jul 20th, 2005, 04:10 AM
#10
Re: Filling and Killing an Array
see the Erase statement also, I cant remember what it does exactly
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jul 20th, 2005, 04:28 AM
#11
Re: Filling and Killing an Array
 Originally Posted by MrPolite
see the Erase statement also, I cant remember what it does exactly 
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.
I don't live here any more.
-
Jul 20th, 2005, 04:39 AM
#12
Thread Starter
Lively Member
Re: [RESOLVED] Filling and Killing an Array
*avoids erase like the plague*
:|
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|