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 / I can't compile anything in DB Pro

Author
Message
Juan De Abreu
15
Years of Service
User Offline
Joined: 17th Dec 2010
Location: Mushroom Kingdom
Posted: 29th Dec 2010 13:16
I'm first bought DarkBasic Professional not long therefore i'm still very new to it, that's why i started with the easy excersice of

SET DISPLAY MODE 800,600,16
CLS
PRINT "Hello World"

But for some reason it won't compile it! it used to work perfectly before, the Dark Basic does work but i dunno why The DB Pro doesnt... help anyone?
Visvalor
15
Years of Service
User Offline
Joined: 29th Dec 2010
Location:
Posted: 29th Dec 2010 18:17
I have the same problem, so I put "wait key" at the end and it waited for me to press a key to close at least

"Tis better to die on your feet, than live on your knees" - Emilio Zapato
Blobby 101
20
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 29th Dec 2010 19:11
In DBPro, there isn't a "test environment" like in DBC where you can run your program within the editor and when it finishes you get that message at the bottom. In DBPro, when a program is compiled it physically creates an EXE which it then runs. So when a DBPro program finishes, they just close. Obviously in a real program/game you'd have a loop which would stop it closing but if you're just testing something like this then you'll need to add wait key to the end so that it stays open.

dn5
15
Years of Service
User Offline
Joined: 23rd Dec 2010
Location:
Posted: 29th Dec 2010 19:34
What you basicly do in your code is set the resolution (set display), clearing the screen (cls), and output the text (print).

So you run program and it goes:

-> Set display mode
-> Clear the screen
-> Print the text

But what when it finish all that? You don't have anything so you can stop that for a while so you can read the text you have printed.

By putting "Wait Key" you are waiting for any button to be pressed. If no button is pressed, the program will just stay there forever. You can use "Wait Mouse" instead, if mouse is clicked anywhere the program will close, else it will just stay there forever and you can read that text forever.

In most language you wont be able to run program without properly exit:

Batch -> "Pause"
DBPro -> "Wait key" or "Wait mouse" or "Wait (miliseconds)"
Pascal -> "end."
etc.

Visual Basic 6 already have integrated command in project it self so its not needed.
I make it little longer than I should but you will quite understand much better.

[Its just me - and my opinion]
Juan De Abreu
15
Years of Service
User Offline
Joined: 17th Dec 2010
Location: Mushroom Kingdom
Posted: 8th Jan 2011 16:54
it worked thanks everyone for your time!!

Login to post a reply

Server time is: 2026-07-19 03:41:32
Your offset time is: 2026-07-19 03:41:32