array of locations

Bart Vervenne
04-11-2003, 11:49 AM
Is there a way to make a dynamic array ?
All samples I found until now use following syntax. The don't allow to change the upper limit of the array, or to use a variable instead.
Dim objLocs(1 To 5) As MapPoint.Location
When i try to use the standard VB way to create a dynamic array :
Dim objLocs() As MapPoint.Location
PPCount = 10
Redim objlocs(PPcount[/i])
I always get an error on the line where the polygon is added.
mymap.shapes.addpolygon objlocs
My problem is that I want to draw different polygons on my map , depending on data in an access database.
Sorry about my bad english, I hope someone understands my problem and is able to give me some advice.

Thanks a lot
[/i]

Bart Vervenne
04-11-2003, 12:08 PM
Correction of previous topic
Is there a way to make a dynamic array ?
All samples I found until now use following syntax. They don't allow to change the upper limit of the array, or to use a variable instead.
Dim objLocs(1 To 5) As MapPoint.Location
When i try to use the standard VB way to create a dynamic array :
Dim objLocs() As MapPoint.Location, PPCount as integer
PPCount = 10
Redim objlocs(PPcount)
I always get an error on the line where the polyline is added.
mymap.shapes.addpolyline objlocs
My problem is that I want to draw different polylines on my map , depending on data in an access database.
Sorry about my bad english, I hope someone understands my problem and is able to give me some advice.

Thanks a lot

Anonymous
04-14-2003, 12:47 AM
You can do the following:

Redim objlocs(1 to PPcount[/i]-1)

That might work. Or try:

Option Base 1

somewhere in the code.

Bart Vervenne
04-14-2003, 04:03 AM
Thanks for your reply. It works.
Indeed arrays in mappoint cannot be zero based for some obscure reason

 
Web mp2kmag.com
mapforums.com