Announcement

Collapse
No announcement yet.

OOP

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OOP

    Hello Stephane,

    I was thinking of putting this subject in the PowerBasic for Windows forum.

    OK, to come to the subject. I think it is a major asset to any programming language
    today to add OOP functionality in the compiler. Therefor, I do hope that powerbasic
    get into this realm too. Especially if you want to create COM objects you need to
    provide the basic mechanisms of OOP.

    It would be nice if we could say something in PowerBasic like

    Class Maths () public
    private x as integer
    private y as integer
    constructor Maths()

    end constructor

    destructor Maths()

    end destructor

    public method SomeMethod(x as integer) as Long

    x = this(x) '// Get the x from the parameter.

    end method

    public property Get SomeProperty() as String

    end property

    public property Set SomeProperty(Value as Long)

    end property

    end class

    FUNCTION PBMAIN()

    Dim M as Maths()

    Print M.SomeMethod(123)

    END FUNCTION

    I think this should be a simple syntax. Method overloading would be a nice feature too.
    So, any body for or against OOP ?

    Any comments ?
    So here we are, this is the end.
    But all that dies, is born again.
    - From The Ashes (In This Moment)

  • #2
    Oops,

    Sorry, I didn't see the other posts. Forget this one. As one reader says, it has been bashed over and over, so we leave our
    faith in the hands of the engineers overthere



    ------------------
    So here we are, this is the end.
    But all that dies, is born again.
    - From The Ashes (In This Moment)

    Comment

    Working...
    X