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 / return in function not working

Author
Message
Chewy
20
Years of Service
User Offline
Joined: 1st Jan 2006
Location:
Posted: 16th Aug 2010 03:18
Hi all,

I am a bit confused with this as it used to work fine.

I have a function like:

function test()

if something = 0
return
else

endif
endfunction

any reason why its not working?

MjMAC
---------------------------
Intel Core 2 Quad Q6600 @ 2.4GHz | 2 x XFX 8800GTs Alphadog (SLi) | 4GB RAM
Pharoseer
19
Years of Service
User Offline
Joined: 21st Feb 2007
Location: Right behind you
Posted: 16th Aug 2010 03:43
RETURN is used to return from a subroutine, not a function. A subroutine has the form:



Try using EXITFUNCTION instead.
Chewy
20
Years of Service
User Offline
Joined: 1st Jan 2006
Location:
Posted: 16th Aug 2010 03:49
aaah, im just too use to php lol.

I swear return in function in DBp use to work though.

Thanks though

MjMAC
---------------------------
Intel Core 2 Quad Q6600 @ 2.4GHz | 2 x XFX 8800GTs Alphadog (SLi) | 4GB RAM
Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 16th Aug 2010 04:28
i've gosubed a function before and it worked fine :/ it's messed up :p

Login to post a reply

Server time is: 2026-07-25 08:27:54
Your offset time is: 2026-07-25 08:27:54