Creating Huge Arrays with ReDim Keyword

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 ahuge array. You have to say this statement like this:

ReDim Preserve InPutFile(Count) as String * 40

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several