Solved

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

Posted on 2003-11-06
4
407 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 51

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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