Results 1 to 2 of 2

Thread: Passing Objects...

  1. #1

    Thread Starter
    Addicted Member Dim A's Avatar
    Join Date
    Jul 2000
    Posts
    201
    I have this type of class structure in my program:

    Class1 - strings, longs, and doubles.

    Class2 - collection of class1 and a few strings

    Now I have a form that takes in or modifies values of type class1 by loading or taking the data in from yet another form, and adds them to a variable of type class2.

    I'd like to pass a reference of class1, by using a class2 reference.

    I thought it'd be something as simple as adding this property get to my class2...
    Code:
    Public property get class1(ByVal seqnum As Integer) As   class1type
           class1 = class2Obj.class1Col.Item(seqnum)
    End Function
    but this results in a dynamic variable/no with block declared error.

    Obviously, this is getting a little complicated, but hopefully you can at least see what I'm trying to do and give me some advice.

    Also, is there anything special I have to write into my class to allow set class=class statements to work?

    Thanks.

  2. #2
    Lively Member
    Join Date
    Apr 2000
    Location
    Hell
    Posts
    89
    To ASSIGN an object variable, you have to use Set:

    Public property get class1(ByVal seqnum As Integer) As class1type
    Set class1 = class2Obj.class1Col.Item(seqnum)
    End Function


    - Steve

    Real programmers use COPY CON PROGRAM.EXE

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