Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Does Visual Basic have an array size limit?

Posted on 2004-03-23
7
Medium Priority
?
1,637 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 150 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes

927 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