Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: CrAz3D on June 21, 2004, 03:19 PM

Title: ParramArray as Variant
Post by: CrAz3D on June 21, 2004, 03:19 PM

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

Error I recieve is that the object variable or with variable is not set, it highlights:
PlugY(UBound(PlugY)) = Obj(i)

I am accessing this sub by:


ClassName.LoadObjects Queue, "Queue", Funcs, "Functions"


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
Title: Re:ParramArray as Variant
Post by: CrAz3D on June 21, 2004, 03:42 PM
Set PlugY(UBound(PlugY)) = Obj(i)
Forgot one little word, set