Method & Functions

Just starting out? Need help? Post your questions and find answers here.
Pot Noodle
Enthusiast
Enthusiast
Posts: 202
Joined: Sat Feb 18, 2012 10:21 pm
Location: Leicestershire

Method & Functions

Post 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.
P.N.
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Re: Method & Functions

Post 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.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply