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 ?
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 ?
Comment