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 / absolute beginner - help please

Years of Service
User Offline
Joined: 11th Oct 2002
Location: United Kingdom
Posted: 30th Oct 2002 11:17
I've just installed DBpro. Never attempted any programming before and am really floundering.

Have gone through GETTING STARTED - didn't understand all of it though.

Gone through the EXAMPLES section and couldn't follow a lot of it.

Then worked through the PRINCIPLES and fared a bit better. Couldn't follow all that stuff about lottery and arrays and restore and branch statements etc.

When I get to the tutorial what am I supposed to do? Di you have to break down all the code because by this stage it still looks like GREEK to me!

In short guys (and gals) help. Is there a better book I can buy to explain all this stuff. I really need a concise step by step book to lead me through.

Cheers everyone.
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 30th Oct 2002 15:02
Well, the main problem is that your new to programming. So, your gonna have to take it really easy to start. I suggest you start VERY simple, and work your way up, teaching yourself on the way because the docs are woefully inadequate. They are being worked on though.

>Start by figuring out and using the PRINT command. Just use the print command a couple times, saying stuff like "hello world"
>Continue by using the input command, then take the user's input and print it out again. This introduces simple variables and input.
>Work your way up to a number guessing game, were using the RND() command, the computer picks a random number and the user has to guess it, he gets 3 tries, and if he is too high or low when he guesses, the computer prints "too high" or "too low" accordingly. If you can get that done, then you'll have a better basis. After you can continue along this path, or try to go through the tutorials, etc. Don't start worrying about graphics anytime soon!

Alex Wanuch
aka rapscaLLion
Get the DB Weekly Newsletter at
Years of Service
User Offline
Joined: 5th Sep 2002
Posted: 30th Oct 2002 15:31
1/ If you get completely stuck and you cant find a book on qbasic which comes with older windows systems ready to run. Run an MS dos window and type qbasic and off you go.

2/ check out the 20 lines section on the forum some of the code requires no download you just copy the code.

3/ if you want to do a random game make sure you have

randomize timer()

in your code otherwise everytime you run your game it will produce random numbers in the same order.

I have to admit though its all very daunting when you first look at a darkbasic program. But as rapscaLLion said stick to simple programs no graphics and work your way up . if you look in the 20 line section theres loads on little programs to keep you happy

Years of Service
User Offline
Joined: 7th Oct 2002
Location: Austria
Posted: 30th Oct 2002 17:31
Yes, how true, you cannot expect that your first game will have better physics and graphics than "HALO" or "DOOM III", start with making simple games or applications in order to learn how to master DBP and how make workarounds to the bugs.
My first game was a Adventure with 10 rooms and no parser, and it took me one month to complete. It was coded on a C64.

Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 30th Oct 2002 18:46
rapscaLLion: that's hilarious! you and i almost posted the same thing (look at the newcomers forums)!

wolves: please don't cross post...if you put up your question and don't immediately get an answer, just be patient, an maybe try to rephrase your question so it is more direct. now you have two places where people are going to be giving you different information and won't be able to work together as easily to help you. you're working against yourself!

-= i only do what my rice krispies tell me to do =-
Years of Service
User Offline
Joined: 11th Oct 2002
Location: United Kingdom
Posted: 31st Oct 2002 15:21
Oops - ChipOne

My mistake. I am also new to forums. Will confine myself to one area only, this one. Thanks for the advice. You certainly are a helpful bunch!

I went to DB heaven and found that the author of the site is going to write some basic tutorials - these should help a lot. I think a rather thick manual is required in the bookshops.

Here's looking at you, kid
Marc Fleury
Years of Service
User Offline
Joined: 1st Oct 2002
Posted: 31st Oct 2002 16:41
There already is a from-the-beginning tutorial at


Learn DB here -- -- Learn DB here
Shadow Robert
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 1st Nov 2002 01:21
The DB original manual was pretty good
due to the updated setup of pro though the lessons don't copy direct - which is a shame

tell ya what, i don't think i have the lottery code in the demo manual - so upload it and i'll wizz over it and recomment it, because Lee's comments never were really for the complete beginner

Anata aru kowagaru no watashi!
Years of Service
User Offline
Joined: 11th Oct 2002
Location: United Kingdom
Posted: 1st Nov 2002 12:24
Hi Raven Vegeta

Thanks for the help The lottery code is:
Arrays are going to be a very important part of your
future programs. They allow you to store large
amounts of data under a single name. You can then
access the data by index rather than by name alone.

If you had to write a program that stored each
weeks lottery numbers, typing out 52 unique
variable names is a lot of work, hard to maintain
and quite unnecessary. Arrays allow you to create a
special kind of variable that can store more than
one item of data. You might start your program like

Two hours later, you realize you could have written
it like this:

DIM lottery$(52)
We declare a string array using the DIM command
followed by a name for our array. Like variables,
when we use a dollar symbol after the name we
instruct the program to use the array to store only
strings. We then enclose in brackets how many
items of data we wish the array to store. The array
can be filled almost like a variable, but you must
also provide the position within the array you wish
to store your data.

But you then ask yourself what benefits I would
have gained using the second approach. If you
where also required to print out all 52 lottery
numbers to the screen with your first approach you
would have to add another 52 statements that
printed each variable:

PRINT lottery1$
PRINT lottery2$
PRINT lottery3$
But if you had used an array, the same example
would look like this:

PRINT lottery$(1)
PRINT lottery$(2)
PRINT lottery$(3)
You will have noticed that by using an array, you no
longer have to refer to your data using a unique
variable name. You can now point to the data you
want using a position number. Accessing data this
way has a thousand advantages over trying to
access data by variable name alone, as you will
discover. One example would be to improve the
above like this:

FOR T=1 TO 52
PRINT lottery$(T)
Incredibly the above code replaced 52 PRINT
statements with just 3 statements. With the above
example, T is incremented from 1 to 52 within a
loop that prints out the contents of the array at that

Arrays can also store multiple levels of data. At the
moment our lottery entries are stored as strings and
the numbers are hard to get at. Let's say we wanted
to store all six numbers for every lottery week, we
would create an array like this:

DIM lottery(52,6)
Without the dollar symbol($), we are declaring the
array to store integer numbers instead of strings.
You will also notice we have a second number
separated by a comma. This means for every array
position from 1 to 52, there is a sub-set numbered
1 to 6 in which multiple data can be stored. You can
visualize an array as a filing cabinet with large
draws numbered 1 to 52. Within each of the 52
draws is a tray with 6 boxes inside. You can store a
value in each box. In all you can store 312 (52 x 6)
values in this array. You can have up to five
dimensions in your array, which means you can
create an array as big as (1,2,3,4,5). Be careful
when declaring dimensions, as large arrays
consume large amounts of memory and may reduce
overall performance of your program.

Entering data into our new array is elementary:

You are now able to give your program access to
much more useful data. Unlike the string approach,
you could make your program count how many
times a certain number has appeared.

As you have determined, arrays need to be declared
as a particular type. You can have an array of
integer numbers, real numbers or strings. You
cannot have multiple types in the same array, but
you can declare new arrays dedicated to holding
such data.

As I am a total novice I couldn't make much of this out.


Here's looking at you, kid
Years of Service
User Offline
Joined: 11th Oct 2002
Location: United Kingdom
Posted: 1st Nov 2002 15:48
Still struggling to understand very basics.

Tried running this but it wont work.

rem create cube of 100
make object cube 1,100
rem load image
load image "sadie.jpg",1

rem texture cube
texture object 1,1
rem main loop

yrotate object 1,object angle y(1)+0.5

If I take out the load image line I get a revolving cube - fine.

I am trying to load a photo of the dog called sadie. It's a jpg. Does the program know to look in a certain folder on hard disk or do I have to tell it that also?

I have tried several images but none work.

What does the ,1 mean after the image name?

Thank you all out there. Wish you were here all sitting over my shoulder. I would need a pretty big room I reckon.

Here's looking at you, kid
Flashing Blade
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 2nd Nov 2002 00:56
hi wolves me n00b to dbp too - i programmed vb and pascal and started to learn c++

(1) yes you need to specify path, but easier (especialy if distributing final prog) to put "sadie.jpg" into your current project folder. Or make a folder in your current project folder and call it something like "grafix", then copy sadie file to it, then load with:
load image "grafix\sadie.jpg",1
(2) don't worry if you no understand arrays. When you are writing a program that needs to use arrays then you will learn all about 'em with some trial and error and some manual reading - everything trial and error with a bit of manual reading - reading manual no use unless in conjunction with a prog u making (imho).
Years of Service
User Offline
Joined: 17th Sep 2002
Posted: 2nd Nov 2002 05:05
"What does the ,1 mean after the image name?"

The ,1 means you are loading the image into image #1. If you need to referrence that image later in the code just use 1.

LOAD IMAGE Filename, Image Number

Hey!! You talking to me?
Megaman X
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 2nd Nov 2002 13:22
Wolves, I have a cool DB Manual made to DB Ver 1.9. I know it's a bit old ( perhaps too old ) but it teaches u all the basics and stuff. Tell me if u are entrested here:

I don't suffer from insanity, I enjoy every minute of it.
-- Rogue
Megaman X
Years of Service
User Offline
Joined: 21st Oct 2002
Location: Sweden
Posted: 2nd Nov 2002 13:24
Also, don't think twice when u code with DB, press F1 for help after ALL commands u type, so u can see what it does. There's some tutorials in there, I think u should make them all, do not skip any even if it looks dum. And press F1 in every statment

I don't suffer from insanity, I enjoy every minute of it.
-- Rogue

Login to post a reply

Server time is: 2020-07-14 21:11:00
Your offset time is: 2020-07-14 21:11:00