Results 1 to 18 of 18

Thread: [RESOLVED] about array object variable

Threaded View

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    3,964

    Resolved [RESOLVED] about array object variable

    i'm trying build 1 variable array, that must be object type for saving the objects names...
    heres how i declare the variable:
    Code:
    Public ObjectsName() As Object
    Public NumberObjects As Long
    now i put some objects names in listbos(string, of course)...
    then i must put them in variable array(ObjectsName()) using the listcount property i redim the variable....
    heres the code:
    Code:
    NumberObjects = lstAddCollisionObject.ListCount
        ReDim ObjectsName(NumberObjects)
        For i = 0 To NumberObjects
            Set ObjectsName(i).Name = lstAddCollisionObject.List(i)
        Next i
    and heres how i will use it:
    Code:
    For i = 0 To NumberObjects
                    If Collision(extender.name, ObjectsName(i), ObjectsName(i)) = True Then
                        RaiseEvent Collision(ObjectsName(i))
                    End If
                Next i
    the collision() function only acept objects name(the arguments are objects)...
    note: these objects name are the objects that is puted in form, but the names are manualy declared...
    i recive errors... can anyone tell me what isn't right?
    thanks
    Last edited by joaquim; Aug 20th, 2008 at 05:23 PM.
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width