Results 1 to 3 of 3

Thread: OOP

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313

    Question

    Can anyone brefly explain how to do object orinted programing in VB6, even a simple exampl with just private, and public functions, and private and public vars, and i dont know if one is needed, but a constructor. Thank you very much.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I don't think you can make contructors in vb6, you just use new keyword to create objects.
    Place a classmodule in your project and add a private and a public variable:
    Code:
    private privatevar as long
    private ppublicvar as long
    
    Property Get publicvar() as long
       publicvar=ppublicvar
    end property
    
    Property Let publicvar(newvalue as long)
       ppublicvar=newvalue
    end property
    You can of course declare a public variable public but it won't gain anything (except for time), vb does automatically make a property of it anyway.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Location
    Texas
    Posts
    313

    Question

    What does property let and get do? Like say I wanted to do this, I hope you know some C++

    class
    {
    private:
    int X;
    int Y;
    int HI(int X);
    public:
    bool GetThis();
    bool YN;
    };

    How could I do something like that but VB6?

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