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.

Newcomers DBPro Corner / Object orientation tutorial for DarkBasic Pro only

Author
Message
ReneGade RG
19
Years of Service
User Offline
Joined: 13th May 2005
Location:
Posted: 16th Jul 2005 03:05 Edited at: 16th Jul 2005 03:59
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.
ReneGade RG
19
Years of Service
User Offline
Joined: 13th May 2005
Location:
Posted: 16th Jul 2005 03:33
I guess none cares...goodbye then!

It's amazing you're reading this, surprise... you still are.

Login to post a reply

Server time is: 2024-09-23 23:19:11
Your offset time is: 2024-09-23 23:19:11