Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

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



Application Security Testing: An Integral Part of DevOps

Creating Huge Arrays with ReDim Keyword

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?

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.



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date