Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

PureGDK / Object-oriented programming in PureBasic

Author
Message
Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 16th Oct 2009 01:48 Edited at: 17th Oct 2009 01:50
Although PureBasic is a procedural language it provides support for object-oriented programming through the use of interfaces.

Consider this example which illustrates how to create a rectangle object of with the methods Draw() and Delete():



Detailed information can be found in Stephen Rodriguez's OOP tutorial:

http://www.purecoder.net/oop.zip

Additionally, there are various OOP precompilers which can automate much of this by encapsulating the process in familiar keyword blocks such as "Class":

http://www.purebasic.fr/english/viewtopic.php?f=14&t=30236

http://www.purebasic.fr/english/viewtopic.php?f=27&t=30774

Login to post a reply

Server time is: 2024-03-29 14:23:34
Your offset time is: 2024-03-29 14:23:34