Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VBA property Let - two arguments

So I have two different classes, the main and the object class. The thing is that I want to send two arrays to setArray but Property Let doesn't allow me too. How can I do this, I know that dData.setArray = xData(0), xData(1) is wrong but that's how I would do it if I have one argument.

Main:

dData.setArray = xData(0), xData(1)

Object Class:

Property Let setArray(name As Variant, value As Variant)
    Dim i As Long
    For i = 0 To UBound(name)
        data.Add CStr(name(i)), CInt(value(i))
    Next i
End Property
like image 797
Fredrik Avatar asked Sep 05 '25 14:09

Fredrik


1 Answers

You can have property lets with multiple arguments, but obviously with only one 'right hand side', which is the last argument in the property signature (value As Variant in your case). The assignment syntax for your signature will be this:

dData.setArray(xData(0)) = xData(1)
like image 172
igorsp7 Avatar answered Sep 11 '25 03:09

igorsp7