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.

DarkBASIC Discussion / nesting error. . . .WHERE?

Author
Message
ImAcOmputerGeek
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 2nd Jun 2003 02:26
If anyone has some spare time could they look this over to find a nesting error. I cant find one anywhere yet i keep getting the error notice.
12 year old programmer. . .
seriously
Ag3ntSm1th
22
Years of Service
User Offline
Joined: 13th May 2003
Location:
Posted: 2nd Jun 2003 04:24
i dont see a nesting error

"The secret to creativity is knowing how to hide your sources." - Einstein
ImAcOmputerGeek
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 2nd Jun 2003 05:00
I didn't see one either. I think there is a glitch in my version of dark basic or something. I'll download the latest patch and see.

12 year old programmer. . .
seriously
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 2nd Jun 2003 06:53 Edited at: 2nd Jun 2003 06:56
considering nothing is spaced for readability you deserve to have a nesting error! but...



is where the error is

[edit] i suppose I should divulge as to how i found it..

i ran it thru darkbasic and found the nesting error at another IF THEN statement... which darkbasic said 'hey wait im missing something here'

then i proceeded to look straight up cuz it was obvious to me you forgot an ENDIF... for the very nature of the error and where the error occurred... i spaced all of you if thens so that i could see if something was missing...and about 10 - 20 lines up i found it...

unless something else is wrong it should work

The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Newsgroup : http://groups.yahoo.com/group/DBMag/
andrew11
22
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 2nd Jun 2003 06:58
@Jerico2day
Look again! You only need an Endif if the if statement does not have Then.

Spaced correctly


One if with a then, two without. That makes two endif's.

"Food is güd!" -Dean
"All programmers are playwrites and all computers are lousy actors" -Anon
Click Here!!!
Ag3ntSm1th
22
Years of Service
User Offline
Joined: 13th May 2003
Location:
Posted: 2nd Jun 2003 07:30
i dont even see his code to begin with?!?

"The secret to creativity is knowing how to hide your sources." - Einstein
ImAcOmputerGeek
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 2nd Jun 2003 07:41
Thanks a lot. it helpped very much

12 year old programmer. . .
seriously
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 2nd Jun 2003 07:46
It is only to your advantage to write neater source code.
It helps to identify bugs easier than messy lines of code.

Heres a sample of yours cleaned up and you will see if endif errors alot more clearly by deploying a tab to cascade your code in/endifs.



ImAcOmputerGeek
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 2nd Jun 2003 07:51
is this a little better spacing?

12 year old programmer. . .
seriously
ImAcOmputerGeek
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 2nd Jun 2003 07:52
thanks for the tip. I really needed it.

12 year old programmer. . .
seriously
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 2nd Jun 2003 08:02
oh me oh my i didnt see that:o i suppose i shouldve tested more..i was in such a hurry.... *hangs his head in shame* ill take another look at it in a few minutes

The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Newsgroup : http://groups.yahoo.com/group/DBMag/
ImAcOmputerGeek
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 2nd Jun 2003 08:06
there is another error on the first if/then statement inthe MoveBall sub.I neatended the code out and I still cant figure it out.

12 year old programmer. . .
seriously
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 2nd Jun 2003 08:10
It would be a lot easier if you explored something like the one i showed you but at least your adopting the tab sequences.

the neater and cleaner it is the easier it will be to manage.

bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 2nd Jun 2003 08:10
ok ok..i found it this time... it was a different type of error..

the lines



generate an error because there is nothing to exit from...an exit is used in loops like DO-LOOP,WHILE and REPEAT... as stated in the help files... It will not work on FOR,NEXT loops or GOTO/GOSUB loops..

not sure what ur trying to accomplish..cuz i cant run the code as i dont have the media... but maybe this is what you need?



The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Newsgroup : http://groups.yahoo.com/group/DBMag/
ImAcOmputerGeek
21
Years of Service
User Offline
Joined: 31st May 2003
Location:
Posted: 2nd Jun 2003 23:04
ok. Thanks alot. It is alot easier to catch errors with neater code.

12 year old programmer. . .
seriously

Login to post a reply

Server time is: 2025-05-19 00:17:34
Your offset time is: 2025-05-19 00:17:34