define and declare the procedures outside of the class
i think some of the advance features of oop could be acomplished thru pointers and doesn't have to be internal coded in
right now i love just to have just that format in there its basic and looks clean
Class MyClass1
attribute1.l
Method setAttribute1(value.l)
*this\attribute1 = value
EndMethod
Method.l getAttribute1()
MethodReturn *this\attribute1
EndMethod
EndClass
Class MyClass2 Extends MyClass1
attribute2.l
Method setAttribute2(value.l)
*this\attribute2 = value
EndMethod
Method.l getAttribute2()
MethodReturn *this\attribute2
EndMethod
EndClass
NewObject *obj.MyClass2
*obj\setAttribute1(1)
*obj\setAttribute2(2)
Debug Str(*obj\getAttribute1()) + " / " + Str(*obj\getAttribute2())
*obj\destruct()
End
It is simple to use as a little precompiler before you use the pb-compiler. You can find more informations and the precompiler on the german website: http://members.chello.at/pure-basic-essentials/ (try downloads).
The site is in german, but the precompiler works very good. If there would be some good feedback on the forum or guestbook of this site, Didelphodon may extend this much more. He is paused in the moment, cause of some illness but will keep on working on this in future (i hope so).
The best thing on a way like this is, that everybody can choose if he wants to use oop or not. If it was possible to use this as an addin in the pb-ide, everyone would be happy, or not?
I have recent experience of javascript with DHTML. So much is implicit (or inherited) that you can't be sure if it will work, why it doesn't work or what you need to do to make it work. And when it does work you can't be sure if it is correct or a lucky coincidence that something you have omitted has taken a correct default value (or property), but will not work in different circumstances.
I think it unrealistic to expect any major addition to PB not to worsen the existing functionality. When anything becomes more complex it becomes more difficult to debug. Notice how each release of PB gets progressively more difficult to get right, notice how each release of Windows takes longer to develop. Complex things tend to be less reliable, look at the Space Shuttle.
You probably know this, but in case you dont: You can use JavaScript as a simple or functional (is that the term?) language as well as with in a heavy duty OOPish way. DHTML access to things like, say, stylesheets, require properties, etc, to set/get values, but JS in and of itself needn't have too much reliance on OOP. It had to retain old funtional approach for all the old apps that used it that way.
On the "To OOP or not to OOP" question:
Provided OOPing PB did not break what we have, it is not necessarily a bad thing. Whilst I don't think I personally would use it (the OOP bits) often, there are cases when it would be useful. Esp when dealing with external stuff that is OOPish.
However first PB needs to get it's data types out of the stone age. Even QB (DOS!) had 8 byte floats!
Class MyClass1
attribute1.l
Method setAttribute1(value.l)
*this\attribute1 = value
EndMethod
Method.l getAttribute1()
MethodReturn *this\attribute1
EndMethod
EndClass
Class MyClass2 Extends MyClass1
attribute2.l
Method setAttribute2(value.l)
*this\attribute2 = value
EndMethod
Method.l getAttribute2()
MethodReturn *this\attribute2
EndMethod
EndClass
NewObject *obj.MyClass2
*obj\setAttribute1(1)
*obj\setAttribute2(2)
Debug Str(*obj\getAttribute1()) + " / " + Str(*obj\getAttribute2())
*obj\destruct()
End
It is simple to use as a little precompiler before you use the pb-compiler. You can find more informations and the precompiler on the german website: http://members.chello.at/pure-basic-essentials/ (try downloads).
The site is in german, but the precompiler works very good. If there would be some good feedback on the forum or guestbook of this site, Didelphodon may extend this much more. He is paused in the moment, cause of some illness but will keep on working on this in future (i hope so).
The best thing on a way like this is, that everybody can choose if he wants to use oop or not. If it was possible to use this as an addin in the pb-ide, everyone would be happy, or not?
Kukulkan
Very intresting, I tried to look at the site using WorldLingo. The IDE and precompiler that was being made there looked great. Do you think there might be a English version?
I expect it would take a LOT of time and effort to implement and it will still won't be "right" for some users.
I use OOP in other langauges and when you need it, it's great.
But I haven't missed it it PB yet. If it ever did come along in PB, I would hope it was so transparent
that you could ignore it unless you decided to use it.
I'd rather Fred spent time getting OSX version finished before starting something extra like this.
I love PB for what it is now so whatever Fred wants is fine with me.
I voted yes the reason is pure basic is a basic and yes good for beginners and advanced - but the reason I bought it was I was looking for a next generation language and i looked at loads of differnt basics...
I believe i have found the langauge and it is called pure basic and in time it will prove itself
very few basic use machine code inline which is a big plus
just to show the power JAPBE editor is written in Pure Basic!
ok I have said enough :roll:
I like very mutch pb as i like VB.NET.
The OO is very cool and gives you alot of vantages.
I would love to see a programing language like javascript
Its the most cool OO language and you can do esey classes with sub classes and vars etc.
Sadly theres no JS for programing only for scripting in webpages etc...
have you imagined this?
hwnd=new Window(10,10,500,400,#pb_system_menu,"my win")
btn=new hwnd.Button(5,5,72,20,"OK")
btn.click=function(e){
MessageRequester("My app","You clicked button")
hwnd.title="I changed the title :p"
btn.value="New value on the button !!"
}