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.

Bug Reports / [DBP 7.61] Order of Type Declarations

Author
Message
ShellfishGames
4
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 4th May 2014 15:06
Not necessarily a bug, but certainly undesired behaviour:

+ Code Snippet

Because color_type is declared after the tool_applyColor function and not before, that function seems to simply leave the color parameter out without any error/warning whatsoever.

It's not too unusual that a certain order of declarations is required, but the compiler really should tell me if it decides to just ignore a function's parameter.

(Tested in DBP 7.61, but as I couldn't find a single thread on the issue I just assumed it hasn't been discussed yet and thus probably hasn't been fixed in 7.7 either.. if that assumption happens to be wrong, sorry about that)

Green Gandalf
12
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 5th May 2014 23:32
I agree - and in any case surely it makes more sense to give an error message on the very first line in each case since the UDT is undefined at that point?

The Help file is quite specific (although I thought you could shove them into a subroutine or am I thinking of included files?):

Quote: "To create a user defined type, you must first declare it at the top of your program."




Powered by Free Banners

Login to post a reply

Server time is: 2017-09-19 16:18:18
Your offset time is: 2017-09-19 16:18:18