Is there something special you have to do to pass a variable of user defined type?
thanks
Printable View
Is there something special you have to do to pass a variable of user defined type?
thanks
Take an account that User Defined Type cannot be passed ByVal.
i still get "type mismatch" error
here is my call:
LoadMemory (smlProg)
and here is my function:
Private Function LoadMemory(ByRef smlProg As SML)
End Function
keep in mind my user defined type is called SML
thanks
I've tried to recreate your function and it is working propertly. Here's an example:
Code:Private Type SML
strTemp As String
intTemp As Integer
End Type
Private Function LoadMemory(ByRef smlProg As SML)
smlProg.intTemp = 5
MsgBox smlProg.intTemp
End Function
Private Sub Command1_Click()
Dim utTemp As SML
Call LoadMemory(utTemp)
End Sub
that worked. I guess it was the call loadmemory. and the fact i wanted to send it and return it by value. lesson learned. thanks.
on another note, i could send a normal variable byRef correct?
For a simple variable you can send it either ByRef or ByVal.