Results 1 to 7 of 7

Thread: Classes Vb6

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Posts
    76

    Classes Vb6

    Hi,

    need help on a small application i am creating.... i created two classes however when i set them in one form i cant seem to access them in a different one.. experimented a bit... but dont really know how :d

    pls help
    VB Code:
    1. Option Explicit
    2. Dim player(5) As New player
    3. Dim area(5) As New area
    4. Dim base1, base2 As String
    5.  
    6. Public Sub setclass()
    7. Set player(1) = New player
    8. Set area(1) = New area
    9. Set area(2) = New area
    10.  
    11. player(1).SetUp 4,0,0,0,0
    12.  
    13. area(1).SetUp "player", 1, 0, 0, 0  // each has value reps a different property
    14. area(2).SetUp "enemy", 2, 0, 0, 0
    15. End Sub
    16. Private Sub Form_Load()
    17.  
    18. base1 = area(1).GetDescription
    19. base2 = area(2).GetDescription
    20.  
    21. If base1 <> base2 Then
    22. MsgBox "you fight"
    23. Else
    24. MsgBox "you love each other"
    25. End If
    26.  
    27. End Sub
    that all works... just if i wanna find out what area(1).getdescription in form2.


    thanks in advance


    steve
    Last edited by Hack; Mar 22nd, 2006 at 01:18 PM. Reason: Added [vbcode] [/vbcode] tags for more clarity.

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