[Pardon the crosspost, but it's warranted: A97/VBA5 & MapPoint2004]
Is there a difference in populating arrays between the following two
fashions?
EXAMPLE 1
varColors = Array("Blue", "Yellow", "Red")
EXAMPLE 2
rstColors = "tblColors" (which is populated with one record for each
color)
For intX = 1 to rstColors.Recor dCount
varColors(intX) = rstColors!Color (assume array is properly dim'd)
rstColors.MoveN ext
Next intX
Has anyone ran into difficulty with passing an array into a procedure's
parameter (that calls for an array)? I'm trying to do some automation
with MapPoint, and am running into the issue where Example 1 is the
ONLY method that works. (For those who've used MP, I'm passing the
array to the ArrayOfCustomFi elds parameter in DisplayDataMap. )
I've noticed in the immediate pane that the two methods populate
slightly differently so that the "Type" in Ex#1 shows "Variant/Variant"
and #2 just shows "Variant". Beyond that, I see no difference.
I'm ardent against ugly code. For this procedure, it's not just a
simple text string I'm passing but instead an ugly calculation, causing
(with line continuations) eight blocky lines of code. I'd much rather
a nice clean loop to populate the array, but MP refuses to use it.
Help appreciated in advance.
Thanks,
Anthony.
Is there a difference in populating arrays between the following two
fashions?
EXAMPLE 1
varColors = Array("Blue", "Yellow", "Red")
EXAMPLE 2
rstColors = "tblColors" (which is populated with one record for each
color)
For intX = 1 to rstColors.Recor dCount
varColors(intX) = rstColors!Color (assume array is properly dim'd)
rstColors.MoveN ext
Next intX
Has anyone ran into difficulty with passing an array into a procedure's
parameter (that calls for an array)? I'm trying to do some automation
with MapPoint, and am running into the issue where Example 1 is the
ONLY method that works. (For those who've used MP, I'm passing the
array to the ArrayOfCustomFi elds parameter in DisplayDataMap. )
I've noticed in the immediate pane that the two methods populate
slightly differently so that the "Type" in Ex#1 shows "Variant/Variant"
and #2 just shows "Variant". Beyond that, I see no difference.
I'm ardent against ugly code. For this procedure, it's not just a
simple text string I'm passing but instead an ugly calculation, causing
(with line continuations) eight blocky lines of code. I'd much rather
a nice clean loop to populate the array, but MP refuses to use it.
Help appreciated in advance.
Thanks,
Anthony.
Comment