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 / Functions in #INCLUDE files do not return values!

Author
Message
Darkcoder
16
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 5th Oct 2002 18:44
I'm not sure if this has already been posted. Had a quick look but could not see it (Oh for a search function!).

I've just found out that Function's in #INCLUDE's return a value of zero if ENDFUNCTION is used. If you hard-code the value then it works.

Here's a quick test. This first code is the main project and was saved as test.dba:



This second code was the INCLUDE file and was saved as test2.dba:



You would expect the output to be 1 and 2 but, no, it's 0 and 2. If you move the test1 function into test.dba it works fine.

Oh patch 2, where art thou!!!!!!
System: 1.333Ghz Athlon Thunderbird, 512meg, Geforce 4 Ti 4400.

Hardware /nm./: the part of the computer that you can kick.
haggisman
16
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Oct 2002 19:14
You should be including the files using the project manager not #include

Specs:- 1GHZ athlon, Radeon8500, 192mb ram
Darkcoder
16
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 6th Oct 2002 14:18
OK, that seems to sort it. But at the end of the day I was only basing my code on the examples given that are using the #INCLUDE command!

System: 1.333Ghz Athlon Thunderbird, 512meg, Geforce 4 Ti 4400.

Hardware /nm./: the part of the computer that you can kick.

Login to post a reply

Server time is: 2019-07-16 09:44:26
Your offset time is: 2019-07-16 09:44:26