Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2003-11-06
4
Medium Priority
?
409 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
[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
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
Ryan Chong earned 400 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 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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

704 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