Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arrays

Status
Not open for further replies.

Davidprince

Programmer
Jul 1, 2003
52
AU
Ladies and Gentlemen
This is a follow on from my last question, but unlike the last post this gets to the heart of the matter. My apologies for not thinking of this before posting the earlier query. I have found lots of valuable information on arrays and one example that, whilst obvious in how passing an array is done, didn't contain much of an explanation of what was occurring. Anyway, I would be grateful if someone can comment on the step with the 'CONFUSED note:

Sub AAATest()
Dim StaticArr(1 To 3) As Long
Dim N As Long
StaticArr(1) = 1
StaticArr(2) = 2
StaticArr(3) = 3
PopulatePassedArray Arr:=StaticArr 'CONFUSED
For N = LBound(StaticArr) To UBound(StaticArr)
Cells(N, 1) = StaticArr(N)
Next N
End Sub

Sub PopulatePassedArray(ByRef Arr() As Long)
''''''''''''''''''''''''''''''''''''
' PopulatePassedArray
' This puts some values in Arr.
''''''''''''''''''''''''''''''''''''
Dim N As Long
For N = LBound(Arr) To UBound(Arr)
Arr(N) = N * 10
Next N
End Sub

I realise what PopulatePassedArray is about but am confused by the reference to Arr:=StaticArray. What am I missing in the syntax?
Cheers
David
 
Arr is the named parameter of the PopulatePassedArray procedure.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV
Thanks for the quick response. I should have read Dan Fox's Pure Visual Basic book a little more closely...or at least used the index.
Cheers
David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top