Jump to content
  • Advertisement
Sign in to follow this  
CrimsondestinyX2

DarkBASIC Pro Newbie S.O.S

This topic is 4825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My first question is if there is anyone here who is fluient in DarkBASIC programming that can help me with learning it; or atleast heard of it. I have gone to many forums with people who don't fit either description. I bought DarkBASIC Pro and the Beginner's Guide to DarkBASIC Game Programming and was wondering if the source code written in DarkBASIC should work properly in DarkBASIC Professional? I wrote the Hello World program exactly as it has it in the book, but it doesn't work as it says it should. It's supposed to print hello world, pause print wait, what was that, pause print what, you want more, ask you to type in a number, once you've typed on in, print hello, again corresponding to the number you type. When I run it, all the statements print on the screen simultaneously and when I type in a number, nothing happens. REM------------------------------------------------------ Beginner's Guide to Game Programming with DarkBASIC Copyright (C)2002 Jonathan S. Harbour and Joshua R. Smith Chapter 2 - Hello World program REM------------------------------------------------------ REM Display first message CLS PRINT "Hello, world!." PRINT REM Pause for one second... SLEEP 1000 REM Display second message PRINT "Wait, what was that?" PRINT REM Pause for 1/10 second... SLEEP 1000 REM Display third message PRINT "What, you want more?" PRINT REM Pause for 1/10 second... SLEEP 100 REM Ask user to type in a number PRINT "Type in a number..." INPUT a REM Display the message several times FOR x = 1 to a PRINT "Hello, Again!" NEXT x

Share this post


Link to post
Share on other sites
Advertisement
Perhaps the sleep statement isn't supported in DarkBASIC Pro. Anyway, there are probably more DarkBASIC users in 'For Beginners' so I'll move this thread over there. Good luck with it.

Share this post


Link to post
Share on other sites
Hi,

Change it to this...

remstart
Beginner's Guide to Game Programming with DarkBASIC
Copyright (C)2002 Jonathan S. Harbour and Joshua R. Smith
Chapter 2 - Hello World program
remend

REM Display first message

CLS
PRINT "Hello, world!."
PRINT

REM Pause for one second...

SLEEP 1000

REM Display second message

PRINT "Wait, what was that?"
PRINT

REM Pause for 1/10 second...

SLEEP 1000

REM Display third message

PRINT "What, you want more?"
PRINT

REM Pause for 1/10 second...

SLEEP 100

REM Ask user to type in a number

PRINT "Type in a number..."
INPUT a

REM Display the message several times

FOR x = 1 to a
PRINT "Hello, Again!"
NEXT x

SLEEP 1000


I don't know why, but the REM messes with the command below it. If you can't tell what I did, I simply put a space between REM and the line proceeding it. I also put a sleep after the for loop, otherwise it will zoom by your screen and you won't be able to read it. I went through the trouble of writing a sleep function for you only to find out it had the same problem as this one. I wrote it damn it, so you might as well have it...
:)


function f_sleep(x#)

initial_time# = timer()
time# = 0.0

while time# < x#
time# = timer() - initial_time#
endwhile

time# = 0.0

endfunction


Hope this helps.


-Jojo

Share this post


Link to post
Share on other sites
Thanks Chief! It worked perfectly. And also, thanks for writing the sleep function. BTW, how long have you using DBPRo and have you written any games or other apps with it? If so, I'd like to see 'em!!!

Share this post


Link to post
Share on other sites
Hi,

I actually use DB Classic, but I have a demo copy of DB Pro. I've been using it for about two years and I mainly use it to write simplistic programs I can't be bothered with to write in C++. Some of those programs are of the simulations variety, and some are prototypes for game ideas I have. I'm not sure how much of the language features have changed from DB Classic to DB Pro, but I've found that Dark Basic's language features, or lack there of, are a hinderance to making anything more complex than mindless side-scrollers/FPS games. Not that it can't be done, but when you don't have the luxury of structures and references/pointers doing anything useful is a real pain in the ass. I think it's a great first language and a wonderful starting point to game developement, but it's simplicity for someone like me does more harm than good.

If it weren't for the fact that I just lost my hard drive (I seem to go through a new hard drive about every damn year!) and I'm horrible about backing ANYTHING up, I would send you some of the stuff I've done. I actually finished a simulation for the Math Department at my college about three weeks ago, and I'll contact the head of the department to see if he can't send it to me, replete with source.

-Jojo

Share this post


Link to post
Share on other sites
I sure would appreciate it. I'm kinda glad I picked DB as my first language considering it's simplicity and the fact that I'm pretty much on my own learning it. I did a module in Tech class and it gave me a headache writing this simple program with Visual Basic even with the instructions spelled out for me. Anyways, I will undoubtedly be back for some more help so I'll catch ya later.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
yo are so stupid it is the programming language basic but is the pro edition.I can't figure any of it out anyway cos I bought the pro edition. Maybe I should change to the ordinary one.

Share this post


Link to post
Share on other sites
Greetings,

I consider myself fairly fluent in DarkBasic Pro, and have written many tutorials.

Here's a link to my forum with all the tutorials listed. There's quite a few, and I've written them in a way that you can pretty much jump into any one right away(Though I recommend the Intro to Programming ones first).

If you need further help, just make a post in the tutorial thread, or on the darkbasic board at my forum.

http://www.curvedbasic.com/Forum2/viewforum.php?f=8

MikeS

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
yo are so stupid it is the programming language basic but is the pro edition.I can't figure any of it out anyway cos I bought the pro edition. Maybe I should change to the ordinary one.


Was that serious?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!