Solved

Does Visual Basic have an array size limit?

Posted on 2004-03-23
7
1,622 Views
Last Modified: 2010-05-18
I am using VB6 on Windows XP. I have some arrays that are 7 by 6 million. I found through experimentation that increasing my RAM from 512M to 1G allowed me to get an array of 6 million. If I increase my RAM some more, can I increase my array size or does VB put some numerical limit on the size of an array?

thanks!

jeff
0
Comment
Question by:jscharpf
7 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 10659502
Not certain... but it seems like it's 64K (so it would depend on what you are storing in the array:

see here:

http://www.nsbasic.com/palm/info/technotes/TN08.htm
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 10659565
HOWEVER, i just tried it... and i did an array of 50000 strings whiich is well over the constraints the above link mentions. I know in c/c++ array size is theorhetically limited by amount of stack space. I'll do some more research
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 50 total points
ID: 10659643
after further research, i couldn't find anything in MSDN nor google. I'm gonna go out on a limb and say the max size of the array is dependant on the amount of memory you have available.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:jscharpf
ID: 10659646
So far I've done 6 million single precision numbers..
I was at 4 million until I upgraded my RAm..
This is why I ask what the limit is. 64 thousand is definitely not correct.

Jeff
0
 
LVL 9

Expert Comment

by:_ys_
ID: 10661243
Given that the LBound / UBound pair can return Long values, we potentially have a very big array.
0
 

Author Comment

by:jscharpf
ID: 10661333
I guess I have to accept that :)
0
 
LVL 1

Expert Comment

by:j_chakraverty
ID: 10672100
Hi seems an answer is accepted but i'd like to leave a few comments

[1]
all platforms and programming language has a theoratical uppel limit to every aspect of it. and a practicle upper limit too which is mostly lower than the
whatever it is it is certainly a power of (2^n)-1
[2]
VB or any programming language will not put any upper limit ( unless it is a workaround for some bug in compiler or interpreter) such upper limits are OS governed

[3]
When we test arrays we do so with a code that does nothing else in practicle thats rarly the case.

[4]
with array the ram usage increases exponantially. I do not remember the source but i do remember reading it in a book




0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now