Valhalla Legends Forums Archive | Visual Basic Programming | ParramArray as Variant

AuthorMessageTime
CrAz3D
[code]
Public Sub LoadObjects(ParamArray Obj() As Variant)
ReDim PlugY(0)
ReDim PlugL(0)

On Error GoTo LoadER
For i = LBound(Obj) To UBound(Obj) Step 2
MsgBox Obj(i + 1)
PlugY(UBound(PlugY)) = Obj(i)

PlugL(UBound(PlugL)) = Obj(i + 1)
ReDim Preserve PlugY(UBound(PlugY) + 1)
Next i
Exit Sub
LoadER: MsgBox "Load OBs" & Err.Description
End Function
[/code]
Error I recieve is that the object variable or with variable is not set, it highlights:
[code]PlugY(UBound(PlugY)) = Obj(i)[/code]

I am accessing this sub by:

[code]
ClassName.LoadObjects Queue, "Queue", Funcs, "Functions"
[/code]

Queue & Funcs are both classes

Any ideas?


*Sorry about the code tags, for some reason I can't get them to work, I change it & then they go back to how they were before
June 21, 2004, 8:19 PM
CrAz3D
[code]Set PlugY(UBound(PlugY)) = Obj(i)[/code]
Forgot one little word, set
June 21, 2004, 8:42 PM

Search