Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: PowerBasic Object Oriented Programming

  1. #1
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    PowerBasic Object Oriented Programming

    Guys, I haven't updated my PowerBasic 8 because from the little bit I saw about the new OOP, it didn't seem easy or intuitive to me. Now that it has been out for a while and hopefully some of you have been using the new OOP features I would like your honest reviews on these new OOP features.

    Perhaps you can give some examples of classes you might have made to show how it all works.

  2. #2
    Member REDEBOLT's Avatar
    Join Date
    Dec 2006
    Location
    Pickerington, Ohio, USA
    Age
    87
    Posts
    62
    Rep Power
    24
    Hi kryton9,

    Take a look at My first COM object - MATRIX.

    If you have questions, please ask.


    Regards,

    Bob

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    To me every new version of PowerBasic is worth to be bought.
    It is the only Basic language I feel comfortable. Maybe it is my limit but maybe it is PB characteristic.

    Among many other new features, PB version 9 introduced OOP.
    Among many other new features, PB version 10 better organized it and from one side simplified COM programming and from the other simplified general OOP paradigm.

    thinBasic is still developed using PB 9.x but very soon I will move to PB version 10.x
    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

  4. #4
    thinBasic is still developed using PB 9.x but very soon I will move to PB version 10.x
    If Windows is the only platform you have plans to support with thinBasic, then PB 10 would probably be the best choice for thinBasic 2.0. If you would like to offer a richer experience with thinBasic and offer your language on other platforms in the near future, OxygenBasic is a MUCH better choice. I know you have taken a lot of heat from Zale in the past for creating a Basic language with PB and that's sad. Just imagine if you had the source to the Basic compiler you're using. Wouldn't that open up new opportunities for your users you could never offer staying the PB path?
    ScriptBasic Project Manager
    Project Site
    support@scriptbasic.org

  5. #5
    PB is not an OOP language. COM (as implemented in PB) and OOP share the use of classes and objects, but that's all. COM does not use OOP thingies such multiple parametized constructors, operator overloading, multiple inheritance or polymorphism. PB 10 has one of the best low-level COM support in any language, but instead of taking advantage of it, most PBer's are trying to do OOP.

    "To understand COM (and therefore all COM-based technologies), it is crucial to understand that it is not an object-oriented language but a standard. Nor does COM specify how an application should be structured; language, structure, and implementation details are left to the application developer. Rather, COM specifies an object model and programming requirements that enable COM objects (also called COM components, or sometimes simply objects) to interact with other objects. These objects can be within a single process, in other processes, and can even be on remote computers. They can be written in different languages, and they may be structurally quite dissimilar, which is why COM is referred to as a binary standard; a standard that applies after a program has been translated to binary machine code."

    See: http://msdn.microsoft.com/es-es/libr...,VS.85%29.aspx

  6. #6
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404
    Thanks for thoughts and examples guys. Jose's post I guess hit the nail on the head of why I was unable to really grasp it... I never really understood COM either.

    Bob it now struck me why you posted "My first COM object - MATRIX."

  7. #7
    PB 10 has one of the best low-level COM support in any language ...
    any language meaning ALL languages and not just Basic?

    Does that statement still hold true without your includes and supporting tools?

    My problem with PB is that COM/ActiveX was the thing in 2000. It's taken 12 years to offer usable COM support? (excluding a COM visual container, .NET and most everything else that is currently being use today in Windows) Can you believe 64 bit still isn't on the PB radar screen? PB Linux isn't even being talked about any longer.
    Last edited by John Spikowski; 28-09-2011 at 06:14.
    ScriptBasic Project Manager
    Project Site
    support@scriptbasic.org

  8. #8
    > any language meaning ALL languages and not just Basic?

    Yes. Remember that I'm talking of low-level COM, not of Automation. Regarding low-level COM, only C++ is more powerful, although is much more difficult to use.

    > Does that statement still hold true without your includes and supporting tools?

    Low-level COM does not use type libraries, but interface declarations. Therefore, you need headers. C++ also needs headers. The only difference is that the low-level COM interface declarations for C++ have been written by Microsoft and the ones for PB have been written by me.

    > My problem with PB is that COM/ActiveX was the thing in 2000.

    ActiveXs don't interest me. They were written to be used by Automation languages such VB6 and for Internet Explorer, but VB6 is now dead and the use in the browser began to be avoided many years ago for security reasons.

    But if with "was the thing in 2000" you mean that is no longer useful, you can't be more wrong. It is alive and well. Almost all the new Vista/Windows 7 APIs have been written as low-level COM servers, including the Ribbon framework, that no longer uses the ActiveX technology and therefore doesn't need an OLE container, Direct2D, Direct Write, etc. And the new Windows Runtime, planned for Windows 8, is being written using low-level COM.

    > It's taken 12 years to offer usable COM support? (excluding a COM visual container, .NET and most everything else that is currently being use today in Windows)

    "Usable" can be only applied to Automation, that was implemented several years ago in PB 7.0. Direct interface calls and native unicode support, as implemented in PB 10, is superb.

    I wrote my own OLE container mainly to we able to host the Web Browser control (without having to use ATL.DLL or another external container), that with the use of Dynamic HTML, CCS, HTML5 and javascript offers many possibilities.

    Almost nobody still develops ActiveXs today. NET assemblies can be used with PB if you write them properly or if you produce a COM callable wrapper. I have an small class that allows to host any version of the .NET runtime, but I'm not interested in writing assemblies.

    > Can you believe 64 bit still isn't on the PB radar screen?

    Just as we had a 32-bit compiler when we really needed it, we will have a 64-bit compiler in due time.

    > PB Linux isn't even being talked about any longer.

    Who cares?

  9. #9
    Member REDEBOLT's Avatar
    Join Date
    Dec 2006
    Location
    Pickerington, Ohio, USA
    Age
    87
    Posts
    62
    Rep Power
    24
    Quote Originally Posted by kryton9 View Post
    Thanks for thoughts and examples guys. Jose's post I guess hit the nail on the head of why I was unable to really grasp it... I never really understood COM either.

    Bob it now struck me why you posted "My first COM object - MATRIX."
    kryton9, I don't really understand COM either.



    Bob

  10. #10
    > PB Linux isn't even being talked about any longer.

    Who cares?
    Obviously no one using PowerBASIC. Silver lining is that PB runs fine under Wine.
    ScriptBasic Project Manager
    Project Site
    support@scriptbasic.org

Page 1 of 2 12 LastLast

Similar Threads

  1. A Model for Object Oriented Programming
    By Charles Pegge in forum Machine Code: script sources and examples
    Replies: 5
    Last Post: 10-03-2008, 00:22
  2. How to get an indexed object in COM
    By marcel in forum COM
    Replies: 19
    Last Post: 12-11-2007, 16:04

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
  •