Solved

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

Posted on 2003-11-06
4
404 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 50

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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 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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

816 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

13 Experts available now in Live!

Get 1:1 Help Now