I created a simple function to test using script-only stacks and library stacks:
Code: Select all
function addNumbers x,y
return x+y
end addNumbers
If I then perform the following test in the LC IDE:
1. Open addNumbers stack
2. Open the message box & ensure this stack is "current", i.e its name shows on top bar of message box
3. Type
Code: Select all
put addNumbers(x,y)
I would expect the result to be shown in message box output area. Instead get
If then in message box I typeerror in function handler
Code: Select all
start using stack <path to addNumbers.livecode>
(I think this message needs to be clearer or explained as it’s ambiguous when you see it in full).A stack with the same name as the one you are trying to open is already open. What do you want to do with the stack…?
I then click Cancel to this, or do nothing if no message appears.
Then retype
Code: Select all
put addNumbers(x,y)
This time I get the expected answer, the sum of x & y. So there is no error in the function handler as the first error message said and although I clicked Cancel to the second message it seems to have made some change of state allowing the expected result to be returned.
Any feedback welcome.