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.

2D All the way! / Function Help

Author
Message
Black Shadow
20
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 6th Feb 2005 02:34 Edited at: 6th Feb 2005 02:35
OK I made a function and a variable with it. I can get the variable to turn on inside the function but not outside. Here is the main source code
. Here is the code for the function
. Please Help Me figure out what is wrong.
hyrichter
21
Years of Service
User Offline
Joined: 15th Feb 2004
Location: Arizona
Posted: 6th Feb 2005 09:07
That's because variables inside functions ONLY work inside functions. It looks like you aren't quite understanding how functions work. The value in the parentheses is the value you pass to the function, not the value you get returned. There are two things you need to change:

add this line to the end of your function:
return x
This makes the function return a value, which is what functions are for.

Second, you should have "if FindT(LockOn)=1" Not "if Lockon=1" Lockon is the variable you're passing to your function.

I hope I'm making a little bit of sense here.


Black Shadow
20
Years of Service
User Offline
Joined: 14th Oct 2004
Location:
Posted: 6th Feb 2005 09:40
Thank you so much for your help.

Login to post a reply

Server time is: 2025-05-17 10:15:49
Your offset time is: 2025-05-17 10:15:49