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.

Author
Message
Lilwereboy
16
Years of Service
User Offline
Joined: 21st Dec 2009
Location:
Posted: 29th Nov 2010 08:37
I'm just starting out with Dark Basic Pro. I'm tring to compile this:

health#=100
Print Health#

But for some reason a black box comes up for a milisecond then closes. It wont work with anything please help

Shhhhhhh..... I'm eatin a cheeeeZzzburger
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 29th Nov 2010 09:58 Edited at: 29th Nov 2010 09:58
sync on: sync rate 0

health#=100

while inkey$() = ""
Print Health#
sync
endwhile


=PRoF=
23
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 29th Nov 2010 11:00
The problem is that your code compiles, runs and exits almost instantaneously.

What you need is either a loop, as demonstrated by BatVink above; or a pause; such as Wait key



Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 29th Nov 2010 16:51
Quote: "I'm just starting out with Dark Basic Pro."


And if that variable is ever going to be a decimal it's fine the way it is but if it's never going to be a decimal (like 95.3) then drop the # to make it an integer (a whole number).



You really should check out TDKs tutorials to learn the basics of Darkbasic.

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

Login to post a reply

Server time is: 2026-07-21 13:38:29
Your offset time is: 2026-07-21 13:38:29