This is my code for getting the cities:
Code:
Set tmpDestIDArray = Dest2.GetArrayOfCitiesID
ReDim tmpList(tmpDestIDArray.ItemCount - 1)
ReDim Route_City(UBound(tmpList))
For Index = 0 To tmpDestIDArray.ItemCount - 1
Route_City(Index).Index = tmpDestIDArray.Item(Index)
Route_City(Index).Name = Dest2.GetCityNameFromID(tmpDestIDArray.Item(Index))
tmpList(Index) = Route_City(Index).Name
Next Index
Local_List = tmpList
Like I said it loads it more or less instantly.
I think one of the reasons your code behaves slowly is this line:
Code:
strCityNames(i) = myDest.GetCityNameFromID(myDest.GetArrayOfCitiesID.Item(i))
If I understand it correctly you're querying destionator about the CityID everytime you get a name.
In my code I get an array of this first instead of redoing this every loop.
As far as I can see now (in a bit of a rush) that's the only difference.
EDIT: Disregard the above statement. Our codes are more or less the same... So I don't really see the difference. I'll see if I can verify how many cities I'm loading, but I can't do that before on sunday (I got a tournament to goto this weekend)
Bookmarks