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 / Back again and still stick Syntax Error on Functions

Author
Message
vampyre
17
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 10th Nov 2011 06:15
Hi I am starting up again but managed to get myself stuck , have a syntax nestling error at line 595

Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Nov 2011 21:16
Looks like it might be at the bottom of your update hovercraft function:



Enjoy your day.
vampyre
17
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 11th Nov 2011 03:29
Oh Ok Thanks Latch
TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 27th Nov 2011 20:05


Uggh, that makes me cringe You need to indent your code properly. Of course you get nesting errors if you aren't able to do that. Commands that trigger an extra tab are commands that have an "end command" to them. Here's a list of examples. Each of them have closing commands:



So your code should look like this if you indent it correctly:



And now you can see : Why is the first "if" indented more than the last "endif". You have a nesting error.

TheComet

TDK
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Apr 2012 17:17
Shameless plug time...

If you use DarkIDE, then your entire program is correctly indented automatically!

TDK

http://www.computechtenerife.com
Kevin Picone
17
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 25th Apr 2012 07:36
Wow, there's a number of structural issues with the program, for example take the "CASE" function. Where the function name itself is a DB reserved word. Then logically there's no passed in parameter, so the select is polling a local copy of inVehicle, then we're gosubing potentially in/out of the local scope. Which is a uniquely DB oddity, but you can't rely on functionality. I'd suggest you either decide to go with Sub-Routines or FUNCTIONS and not a mutation of both.



vampyre
17
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 12th Aug 2012 07:51
Sorry been away for a while Dark IDE TDK ? Well I will have to check that out, And Kevin Picone I see , either Functions or Sub-routines but not both OK thank you both very much

Login to post a reply

Server time is: 2020-08-05 08:39:08
Your offset time is: 2020-08-05 08:39:08