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 / Function cannot take input arguments! Help!

Author
Message
Broken_Code
15
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 8th Jul 2013 00:25
Hello,

I've been having some Problems with a function of mine, I get a Crash whenever it's called:
This works:


but this dosen't:


WTF?!?! This is really frustrating and I have no idea why this would happen.

The above is the actual function in my code.

If I REM out the line where this function is called and set the var it Returns to as "Hello World!" then everything works fine, when called without an Input Argument then it also works fine, when called with an Input Argument then I get a Win7 Crash.

Any ideas what could be the Problem here?

Thanks in advance,
Bruce
Broken_Code
15
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 8th Jul 2013 00:49 Edited at: 8th Jul 2013 00:51
OK, solved:

The Problem was the name of the return variable string!
It appears that when a string is returned from a function via a variable that variable cannot be called 'ReturnValue'.

This works:


Thanks,
Bruce

[EDIT] Forgot the code block!
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 8th Jul 2013 05:37
I use Func_Return for my Function Return values.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia

Login to post a reply

Server time is: 2026-07-07 04:30:36
Your offset time is: 2026-07-07 04:30:36