Results 1 to 3 of 3

Thread: PowerBasic: 6th post from Bob about objects

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,795
    Rep Power
    10

    PowerBasic: 6th post from Bob about objects

    http://www.powerbasic.com/support/pb...ad.php?t=38155
    _________________________________________________

    What should a Class look like?
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,138
    Rep Power
    733

    Re: PowerBasic: 6th post from Bob about objects

    Not bad,

    a bit unusual, but what is most important - for invoking method there is finally no OBJECT CALL, so it can be used as any other function.

    CLASS MyClass
    INSTANCE Counter as Long
    INTERFACE MyInterface
    INHERIT iUnknown ' inherit the base class
    Method BumpIt(Inc as Long) as Long
    Temp& = Counter + Inc
    Incr Counter
    Method = Temp&
    End Method
    END INTERFACE
    ' more interfaces could be implemented here
    END CLASS
    It seems the Class-Interface relations ship is very similar to NameSpace-Class in other languages.
    The model PB provides seems to be slightly different from what I know in Delphi/C#, but it is logical.


    Petr



    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,795
    Rep Power
    10

    Re: PowerBasic: 6th post from Bob about objects

    As Josť said, PB way is main tailored for COM automation world rather than OOP.
    So while we will get a great improvement in COM handling (both as client or server) we will get at the same time some OOP methodology to play with. But it is not definitely OOP.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. PowerBasic: 8th post from Bob about objects
    By ErosOlmi in forum Power Basic
    Replies: 0
    Last Post: 08-08-2008, 20:23
  2. PowerBasic: 7th post from Bob about objects
    By ErosOlmi in forum Power Basic
    Replies: 3
    Last Post: 08-08-2008, 17:00
  3. PowerBasic: 5th post from Bob about objects
    By ErosOlmi in forum Power Basic
    Replies: 3
    Last Post: 07-08-2008, 15:42
  4. PowerBasic: 4th post from Bob about objects
    By ErosOlmi in forum Power Basic
    Replies: 20
    Last Post: 06-08-2008, 06:24

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

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