Page 6 of 11
Re: Classes in PureBasic
Posted: Thu Jun 06, 2013 8:28 pm
by rsts
What's a "module"?
Re: Classes in PureBasic
Posted: Thu Jun 06, 2013 8:35 pm
by ts-soft
rsts wrote:What's a "module"?
A module have protected var-, procnames, like a userlib.
You can export vars, functions and so on.
No more conflicts in includes, if you use module.
Re: AW: Classes in PureBasic
Posted: Thu Jun 06, 2013 8:38 pm
by bembulak
Linke a 'unit' in Pascal.
Great news btw.
Re: Classes in PureBasic
Posted: Tue Oct 21, 2014 12:33 pm
by User_Russian
Can make a class, very similar to module.
Code: Select all
DeclareClass Test
; Public elements.
Global x.l
Global y.l
Declare Plus()
EndDeclareClass
Class Test
; Private elements.
Global z.l
Procedure Plus()
Result = x + y
z + Result
ProcedureReturn Result
EndProcedure
EndClass
x.Test ; Create an instance of class.
x\x=2
x\y=8
Debug x\Plus() ; Return value 10.
Re: Classes in PureBasic
Posted: Tue Oct 21, 2014 1:20 pm
by Shield
So not gonna happen.

Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 7:45 am
by User_Russian
Well, why not? This corresponds to the concept of PB and if Fred and the team will do so, it would be great.
Time is now, programming in style OOP, complicated and confusing.
Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 8:34 am
by Shield
User_Russian wrote:Well, why not?
Because Fred doesn't want to. As sad as this is, it won't happen any time soon.
There haven been discussions about adding OO support for years, the answer has always been the same.
This was the reason I switched to other languages that are more suitable to satisfy my needs.
Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 8:51 am
by mestnyi
For this reason, I have moved on to other languages​​,
What if not a secret?
Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 1:38 pm
by User_Russian
Shield wrote:Because Fred doesn't want to.
Fred creates a PB, just for yourself?
PB and so is not very popular. Need to listen to the views community, and implement modern features of a programming language.
Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 3:00 pm
by Fred
So we have to listen to you ? Not everybody wants OOP, and PB won't have a OOP built-in, it's a design choice and I have made it clear a lot of time on this forum. If you don't like it, do as Shield did, find a tool which fits your needs better.
Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 3:12 pm
by skywalk
Fred, would you consider another language spinoff like PooBasic?

Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 3:13 pm
by Fred
PooBasic, really ???????

Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 3:15 pm
by skywalk
I was half kidding.
The other half was serious. I want to import C++ libs without extern C wrappers.

Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 3:25 pm
by Fred
It should may be possible trough special interfaces, so it doesn't requiers built-in OOP.
Re: Classes in PureBasic
Posted: Thu Oct 23, 2014 4:11 pm
by skywalk
Ah, that would be awesome.
The list of C++ libs are growing and not always support extern C.
Forgive my ignorance of features that are OOP limited.
Is the lack of operator and procedure overloading OOP related also?
It is a nuisance to write multiple copies of Procedures just to handle different datatypes.