DarkBASIC Pro Newbie S.O.S
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
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.
Hi,
Change it to this...
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...
:)
Hope this helps.
-Jojo
Change it to this...
remstartBeginner's Guide to Game Programming with DarkBASICCopyright (C)2002 Jonathan S. Harbour and Joshua R. SmithChapter 2 - Hello World programremendREM Display first messageCLSPRINT "Hello, world!."PRINTREM Pause for one second...SLEEP 1000REM Display second messagePRINT "Wait, what was that?"PRINTREM Pause for 1/10 second...SLEEP 1000REM Display third messagePRINT "What, you want more?"PRINTREM Pause for 1/10 second...SLEEP 100REM Ask user to type in a numberPRINT "Type in a number..."INPUT aREM Display the message several timesFOR x = 1 to aPRINT "Hello, Again!"NEXT xSLEEP 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.0endfunction
Hope this helps.
-Jojo
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!!!
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
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
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.
This may be off topic.
I find the idea of the words "Pro" and "Basic" combined to be very humorous hopefully you feel the same way. [smile]
I find the idea of the words "Pro" and "Basic" combined to be very humorous hopefully you feel the same way. [smile]
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.
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
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
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?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement