Solved

Does Visual Basic have an array size limit?

Posted on 2004-03-23
7
1,630 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 …
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…

752 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