I come in from school, get kinda bored and make a topic which might help newcomer or even pros who yearn for object oriented programming in DBPro, whatever mistakes I might have done posting this in, whatever incorrect facts I might have given you, I say....I don't care! Make of it the way you want!
Here it is:
let's start by telling you how to simulate methods/functions like in c++, well, all you have to do is declare either a label which you can either you a gosub or goto command to get to or you can just declare a function to return a new value. I would reccomend storing all your functions on another file and browsing to get them using the toolbar on the right hand side.
example:
method_void_hello:
print "hello world"
return
declare_values:
x=3
y=3
do
method_void_usehello:
gosub method_void_hello
method_with_arguments_that_returns_a_value(x,y,z)
loop
function method_with_arguments_that_returns_a_value(x,y,Z)
x*y=z
print z
endfunction
On what I said earlier about leaving your functions in a separate file and browsing to add the file to your overall project, well this has alot to do with that. Each file you browse and collect can act almost like a class in c++ and you can easily load and go to each function and label (which act almost like c++ equivilant methods).
So create multiple files (which act like classes), add them together, use the label/function syntax (which act like methods) I had just told you about and...voila!
If you understood it, good for you, you may want to try using it.
If you don't get it, DarkBasic is a language based on Basic, that isn't meant to be object-oriented in the first place, goodbye for now.
It's amazing you're reading this, surprise... you still are.