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.

Newcomers DBPro Corner / Tutorial that comes with DBP major problems an really frustrated

Author
Message
Strider 911
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location:
Posted: 8th Jan 2007 20:22
Ok first this is the very first programming language that i have tried to learn so my knowledge about programming is nothing. I got the program and installed it i also got a beginners guide to dark basic game programming by jonathan s. harbour. the issue i have an issue with the tutorial that comes with DBP software tutorial and one of the examples in Johns book. First the DBP tutorial i did the cube thing in the front of the manual and it worked fine. So i tried to do the FPS tutorial in the book and it wasnt working. After that i went into the help thing on the software and it had the tutorial in the book with the code so i copy and pasted it all in a different project window and it still didnt work. i had to add a few < things that was in the book. I have gotten it to complie all the way to the end but once it gets to the last line of code an error message pops up and says #100012: could not close nest at line 274. then it highlights line 274 in red. line 274 is the very last line in this program. So if someone could explain that to me it would be a great help.

now for John's book. The very first program called hello world will not fully work for me. I get the print and sleep command to work except for the last part. the last part is

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

I have gotten to to promt me to put in a number and im am able to put in a number when running the program but it wont print hello again for as many times as i tell it to. It doesnt do anything at all i have tried waiting like 5 mins for it to come up but after 5 mins im still able to add numbers to it also if i hit enter it exits the program and takes me back to where i typed the code. if anyone could help me with these two problems that would be great thanks.
input a
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Jan 2007 21:04
can you post the code inside code tags



Strider 911
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location:
Posted: 8th Jan 2007 21:11
for the tutorial ill try it later on tonight but for the book

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
Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 8th Jan 2007 21:19
You should try putting wait key at the end



Bozzy
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 8th Jan 2007 21:49
That's two errors from DB books today!

As Bozzy says, it's missing a Wait Key at the end of the program.

DBPro executes the code and if it's not told to do otherwise will immediately exit back to the IDE.

I've not read the book you mention, but I know from experience that very often a book which claims to be for beginners is not.

Check out the tutorials at the top of this forum - where more often than not, beginners really does mean beginners...

TDK_Man

Strider 911
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location:
Posted: 8th Jan 2007 22:03
Ok I have DBP on a different computer than i have internet reason being im under 18 still in school so my parents would let me have interent up thier so i burned the program to a cd an am attaching it to this post it should open in dbp this is the tutorial an i put the whole thing in it hope this works

Attachments

Login to view attachments
Code Dragon
18
Years of Service
User Offline
Joined: 21st Aug 2006
Location: Everywhere
Posted: 8th Jan 2007 22:53
I downloaded your file, and it didn't contain your code, just the dbpro file. Dark Basic Pro makes two kinds of files: dbpro and dba. The dbpro file contains important imformation about the project, but the dba file contains the actual source code.

Try uploading again with the dba file.

If that book's tutorials aren't working for you, take TDK's advice and look at the forum tutorials. I highly recommend ruccus' FPS tutorial, both of Sixty Squares' tutorials, and TDK's tutorials. When you understand Dark Basic Pro I recommend my own Pac-Man tutorial (it's not for complete beginners, at least program a Pong and Breakout game first, they're the prequsites.)

Quote: "Gimme teh code!"

Thank you for not flooding the forums with posts like this.
Strider 911
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location:
Posted: 9th Jan 2007 00:07
Ok hopefully i did it right this time. I have looked at ruccus project and plan on trying that next is his site up because i click on the link and it says that the site is not avalible. I just want to figure this out before i start something else thank you all for all your help so far.

Attachments

Login to view attachments
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Jan 2007 07:32
The problem is this (line 156):



And this (line 158):



Both are not closed. You can add this at line 203 to close both the for/next and the if/endif (although the "endif" may actually be higher than that line):



That'll let you run it without error... but all you'll see is a blank screen... because it really doesn't do anything but gosub to lines that only have returns and shows nothing to the screen.

Login to post a reply

Server time is: 2024-11-26 23:38:38
Your offset time is: 2024-11-26 23:38:38