StrataFrame Forum

Passing an array through a property...

http://forum.strataframe.net/Topic16180.aspx

By StarkMike - 5/6/2008

How would I pass an array of integers through a property? Like this?



Public Property TransferIDs() As Int32

Get

Return mTransferIDs()

End Get

End Property
By Trent L. Taylor - 5/6/2008

How would I pass an array of integers through a property? Like this?

What do you mean by "pass" in this case?  Are you just trying to set the property?

By StarkMike - 5/6/2008

I'm trying to pass an array from one form to another...
By Trent L. Taylor - 5/6/2008

Well, all you have to do is pass an array via a parm...set it via a method...or provide a Set on the property:

Via a Method

Private Sub SetMyArray(ByVal items() As Integer)
   '-- Do whatever you want with the passed over array.  Set a property, use the array, etc.
End Sub

Via a Property

Private _MyItems As Integer()
Public Property MyItems() As Integer()
Get
    Return _MyItems
End Get
Set(ByVal value As Integer())
    _MyItems = value
End Set
End Property
By StarkMike - 5/6/2008

Thanks! I was making it harder than it was.
By Trent L. Taylor - 5/6/2008

No problem...I do it all the time! Smile