Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Oct 1, 1996

Creating Huge Arrays with ReDim Keyword

Question:
I am loading a file which is basically a list of numbers into an array. The array is declared as a string. I keep getting an "out of string space" error when the file is larger than about 40K bytes or 3000 lines. The ReDim statement says it can handle HUGE arrays, but is there a Visual Basic limit for the size of an array? How would you handle a situation where the size of the file is larger than the largest size for an array?

Answer:
You need to add a string length to the ReDim statement for it to allow you to use a huge array. You have to say this statement like this:

ReDim Preserve InPutFile(Count) as String * 40
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date