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.

DarkBASIC Professional Discussion / C++ Style Classes in DBP?

Author
Message
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 3rd Jul 2010 02:51
does DBP have any sort of functionality similar to the class in C++?

and if so, how do i use it?

bergice
19
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 3rd Jul 2010 03:21 Edited at: 3rd Jul 2010 03:22
Types:




9cdfb439c7876e703e307864c9167a15
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 3rd Jul 2010 13:08
but other than that... no. It is a procedural language, not object oriented. You cannot have methods, inheritance, polymorphism, none of it!


Is't life, I ask, is't even prudence, to bore thyself and bore thy students?
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 4th Jul 2010 04:25
ok, i can get by with types i think

but just for future reference, is ther any way i can make a DLL with a class and class functions in it and use that in DBP?

im not great with C++ so a tutorial on this would be great if someone knows of one....hell ANY C++ tutorial would be useful.

and yes ik this is the DBP board, not the C++ one

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 4th Jul 2010 04:53
well.... yeah... dlls are programmed in c++, so you can use everything to do with c++ in a dll, as long as the interface is like the standard DBPro commands :
function arg1, arg2, arg3, ... argn
ret=function(arg1,arg2,arg3, ... argn)

there are tuts for making dlls on the dll board.

but yeah, types andfunctions are good. instead of writing something like this:


you can have an array of objects, have a function that creates a new object and returns the index of the new object in the array (basically a pointer), and pass what object it is as an additional parameter to each of the object's methods, IE:



Is't life, I ask, is't even prudence, to bore thyself and bore thy students?

Login to post a reply

Server time is: 2026-07-25 08:12:18
Your offset time is: 2026-07-25 08:12:18