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
21
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
17
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
21
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 11th Nov 2011 03:29
Oh Ok Thanks Latch
TheComet
16
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
21
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
21
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
21
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: 2024-03-28 19:27:25
Your offset time is: 2024-03-28 19:27:25