Thread: Handling Return Values
-
December 24th, 2021, 23:19 #1
Handling Return Values
Trying to figure out how to get a return value from a function, so I can do stuff with it.
Here's my test function:
Code:function addThis(a, b) Debug.chat("The sum is ") return (a + b) end
Code:function onValueChanged() local x = charManager.addThis(1, 25) Debug.chat(x) end
Tried it all local, from within the onValueChanged function (minus the charManager pointer) and it worked fine...
I don't know what I'm missing...
-
December 25th, 2021, 00:37 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,833
Where is your test function defined? Is it in an extension using a script tag with "charManager" (exactly) as the name? (i.e. <script name="charManager" file="..." /> )
Regards,
JPG
-
December 25th, 2021, 00:44 #3
-
December 25th, 2021, 04:04 #4Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
December 25th, 2021, 04:21 #5
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks