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 / Unusual compiler problem - empty line generates error

Author
Message
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 26th Jan 2003 19:55
Sorry if this is covering old ground but I cant find an answer to this problem.

In a bit of code I am currently playing with an empty line generates an error.



Now there may be other problems with this as I cant run it to find any other bugs but I get "#100035: typ definition obj could not be understood at line 118."

Now I understand how to set up type/endtype but line 118 is the empty line after the endtype command.

I am running with patch 3. Dx8.1b (I think b, not 9 anyway)

Any suggestions how an empty line can generate an error?
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 26th Jan 2003 20:11
I think vector is a reserved work... The following helps :



for some reason mass cant be defined as
without an error...

I think types are too unreliable to be used yet unfortunately.

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 26th Jan 2003 20:36
hmm tried changing each of those , vector to vec and mass to weight and changing to a float and still the error...

thanks for the suggestion though!

Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 26th Jan 2003 20:52
OK this gets stranger and stranger...

If I delete all the subtypes in object I still get the error

If I delete the entire type/endtype clause I still get the error message refering to the same (now absent) type "obj"

If I rename the type to anything else the error still occurs.

If I delete the contents of the entore subroutine I dont get the error but of course get a crash at the first time I access one of the variables that would have been declared in it.

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 26th Jan 2003 21:17
Try this :



The problem was some of the funcions had return instead of endfunction

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 26th Jan 2003 21:24
Brilliant. It works (at least that bit does!)

Strange it caused a type error rather than a syntax fault.

Anyway now have to figure out why my collision code is causing strange effects,

Thanks, you've saved my sanity (at least for a few hours!)

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 26th Jan 2003 21:27
The syntax checking is rather poor - wait until you start using reserved commands as variables...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!

Login to post a reply

Server time is: 2025-05-18 18:25:47
Your offset time is: 2025-05-18 18:25:47