Results 1 to 10 of 10

Thread: Trouble! Array of Array of UDT

Threaded View

  1. #1

    Thread Starter
    Member Mythrandil's Avatar
    Join Date
    Mar 2006
    Posts
    55

    Trouble! Array of Array of UDT

    Hey all

    Im having trouble defining an array of an array of user defined types.

    So far i have:

    VB Code:
    1. Public Type POINTAPI
    2.     X As Long
    3.     Y As Long
    4. End Type
    5. Public Points()         As POINTAPI
    6. Public Objects()       As Variant

    VB Code:
    1. Private Sub Form_Load()
    2.     Objects = Array()
    3.     ReDim Points(0) As POINTAPI
    4.     ReDim Objects(0) As Variant
    5. End Sub
    VB Code:
    1. Private Sub cmdcomplete_Click()
    2.     Objects(UBound(Objects)) = Points
    3.     ReDim Objects(UBound(Objects) + 1)
    4.     Erase Points
    5.     ReDim Points(0)

    Basicly points is an array of coords that defines a polygon. When cmdcomplete is clicked this polygon is added to the objects array, and the points array initialized to create another polygon ;d

    Thanks for any help

    /edit, compiler doesn't like line: Objects(UBound(Objects)) = Points

    Stating: Only UDT defined in public object modules can be coerced to or from a variant.
    Last edited by Mythrandil; Apr 30th, 2006 at 08:32 AM. Reason: add error

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