Link to home
Start Free TrialLog in
Avatar of jscharpf
jscharpf

asked on

Does Visual Basic have an array size limit?

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
Avatar of bobbit31
bobbit31
Flag of United States of America image

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
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
ASKER CERTIFIED SOLUTION
Avatar of bobbit31
bobbit31
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jscharpf
jscharpf

ASKER

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
Given that the LBound / UBound pair can return Long values, we potentially have a very big array.
I guess I have to accept that :)
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