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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing parameters by reference

Status
Not open for further replies.

castout

Programmer
Jan 22, 2002
23
US
I have a user defined type that contains three dynamic arrays of strings. I need to write a function that will increase the size of the array if necessary and take a value from a text box or combo box and write it to the array. So, I need to pass in the array that will be written to and the data that will be written to it.
How do I pass the address of the array?
 
Is this what you are looking to do ?

Type type_strings
a() As String
b() As String
c() As String
End Type


Sub Sub_1()
Dim strs As type_strings

Sub_2 strs.a
MsgBox strs.a(3) 'prints a "d"; 4th element (0,1,2,3)
End Sub

Function Sub_2(str() As String) As Boolean
ReDim str(4)
str = Split("a b c d ")
End Function

DsB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top