Page 1 of 1
Method & Functions
Posted: Sun Sep 08, 2013 6:10 pm
by Pot Noodle
PB does not use Methods or Functions, what would you use instead Procedures?
This may seam like a stupid question but it seams strange.
Re: Method & Functions
Posted: Sun Sep 08, 2013 7:25 pm
by tinman
Pot Noodle wrote:PB does not use Methods or Functions, what would you use instead Procedures?
This may seam like a stupid question but it seams strange.
Yes, you would use Procedures.
If you are coming from a C or C++ background then a Procedure is the exact replacement for a function.
You can use a Procedure to implement a method, since they are just functions which take a hidden pointer to the object that the method is being called on. You can use Interfaces to implement objects/classes with methods.
If you want other OO features you can find examples on the forum but it's not natively supported in PureBasic.