Results 1 to 4 of 4

Thread: Can/how done

  1. #1
    Member
    Join Date
    Feb 07
    Posts
    39

    Can/how done

    is it possible to create like a structure or class so that i can just put like

    player1.color = green

    something like that.

    It would make everything a whole lot easier.
    I remember being able to do something along those lines in c++ but really not sure how in vb.net
    thanks
    -blackout

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 02
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Can/how done

    They are pretty much the same:
    vb Code:
    1. Structure Player
    2.     Public color As Integer
    3. End Structure
    4.  
    5. Dim player1 As Player
    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3
    Frenzied Member
    Join Date
    Oct 03
    Posts
    1,301

    Re: Can/how done

    Shouldn't that be Type?

    You can also make a class:
    Put in it:
    [vbcode]Private vColor As Long

    Public Property Get Color() As Long
    Color = vColor
    End Property
    Public Property Let Color(nColor As Long)
    vColor = nColor
    End Property[/vbcode]

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 02
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Can/how done

    Quote Originally Posted by jeroen79
    Shouldn't that be Type?

    You can also make a class:
    Put in it:
    vb Code:
    1. Private vColor As Long
    2.  
    3. Public Property Get Color() As Long
    4.     Color = vColor
    5. End Property
    6. Public Property Let Color(nColor As Long)
    7.     vColor = nColor
    8. End Property
    Not in .NET.

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

Posting Permissions

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