Solved

Error when declaring an array - "integer constant expected" 0x800A0402

Posted on 2003-11-06
4
401 Views
Last Modified: 2012-06-21
I'm trying to declare an array whose size is based on other arrays, but get an error, as listed in question title. Can anyone shed light on this? Here's the code:

first array declared, such as:
Dim CountryArray
CountryArray = Array("Australia","USA","England","Iraq","Istambul","Yugoslavia")

Here's the one I get the error with:
Dim MDPArray(((UBound(CountryArray)+1)*3)-1,13)

TIA
0
Comment
Question by:Chris_Granger
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 100 total points
ID: 9699008
Try:

Dim MDPArray
Redim MDPArray(((UBound(CountryArray)+1)*3)-1,13)

cheers
0
 

Author Comment

by:Chris_Granger
ID: 9699030
That works fine, thanks!  Not sure why it doesn't work the other way but....
0
 
LVL 58

Expert Comment

by:Gary
ID: 9699031
Use ReDim instead of Dim, you can't dynamically set an array that way.
0
 
LVL 58

Expert Comment

by:Gary
ID: 9699038
Hmm reloaded question and nothing here.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

15 Experts available now in Live!

Get 1:1 Help Now