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 Professional Discussion / Error: Function delcaration \'<function name>\' must be outside any program nests at line <number>.

Author
Message
ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 29th May 2011 20:59
Hey,

I keep getting this error during compile time: Function delcaration 'resolveDirection' must bbe outside any program nests at line 131. Thanks!



Sam
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 29th May 2011 21:44
What do you expect an IF statement with no check to actually do? You have two of them.

DVader
22
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 30th May 2011 16:41
Yes IanM is right although he perhaps doesn't go into much detail. You have 2 if - end if statements with lots of if then statements inside. Get rid of the if end if around them as they are not needed. The If Endif statement is the same as if then, it just allows you to add in more checks or more results than a standard if then statement. There is no point at all with the following code example.

As you are not actually checking for anything. You are doing that but putting if then statements inside the if endif loop.

You need conditions on your if endif statement exactly the same as an if then statement.

http://s6.bitefight.org/c.php?uid=103081
ArcherSam
15
Years of Service
User Offline
Joined: 13th Mar 2011
Location: Florida, US
Posted: 30th May 2011 23:43
LOL! Thanks a lot. I should really take a breaks when programming.

Login to post a reply

Server time is: 2026-07-11 02:36:29
Your offset time is: 2026-07-11 02:36:29