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 / NESTING ERROR!!!!!??????

Author
Message
Major Payn
20
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 23rd Dec 2003 20:00
I am new to dark basic and have been trying to make a game but I keep getting these nesting error codes. It says nesting error on this line of code. and also when I was trying to make a pong game it said nesting error and highlighted the sync:loop command. What are thes errors and how do I fix them.

Guns dont kill people, death kills people.
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 23rd Dec 2003 20:11
Post the rest of the code. db tends to report the wrong line with nesting errors.

I think there can be problems putting sync and loop on the same line, change it to
sync
loop

Just loop at all the if blocks arround the reported line and make sure they all the endif are there.
If you want someone to look at your code and point out the errors you need to post more code as the error isn't on that line.

dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 23rd Dec 2003 20:19
nesting error is when you have the start of a loop without the end. for exsample: if you have a do without a loop or a for without a next it will report an error. it always returns the wrong line number as it just gives the last line of your code


Major Payn
20
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 23rd Dec 2003 20:37
am I supposed to put an endif after every action?

Guns dont kill people, death kills people.
Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 23rd Dec 2003 20:42
Syntax for if..thens:
IF coundition THEN action

^^ you dont need a endif

If condition
action
action
{ELSE
other actions if condition is false}
ENDIF

^^ you dont need elses but you do need an endif


Login to post a reply

Server time is: 2024-09-21 14:59:00
Your offset time is: 2024-09-21 14:59:00