The situation:
You create a function with parameters and a result.
Inside the function block you have to calculate several values by help variables. It is a logic catastrophe to use global (app) variables for this.
And in bigger projects you loose overview.
Of course you could implement additional parameters to use them as local variables. But that is not a proper solution.
Or you can construct a count loop that you do not use and use the names of the loop variables. But is that a solution.
What do you think?
Is this what you mean! There are “helper” or local variables to be used in the function blocks. Try clicking the settings wheel on the function blocks.
Parameters (input) in functions are local variables. That is correct.
But when you create them with the function, you have pass values to them when using the function.
What I mean, are local variable to be created inside (!) the function. These could be used for temporary use in the function only and are not accessible outside the function.
“Open Parameters” in function call look rather strange.
As a teacher and author of a books on app development I have some “problems” with that “solution”.
I want to teach the use of functions (with local variable) in Thunkable X properly and in my publications. I cannot use a “slightly ugly” workaround.
Could we expect local variable in future updates of Thunkable X?
I mean near future.
@domhnallohanlon domhnallohanlon, jared idea and your idea of using parameters as local varibles… I agree
well [domhnallohanlon] your work around it’s quite nice but to do what rollke and many other people need the question is: why I need an app or stored variable to send the result?
I mean in your work around I could be happy if just I could put “temp” directly as the return value
that is enough, but it’s not working (at least not working for me)
POST1: I have been testing this and I think we can asume the parameter variables are READ ONLY and because of that you can not use them to operate or to return a result
@jared your idea of using parameters as local varibles… I agree
but in your blocks you can’t use any of that “helper” variables to set the return value
the question is: why I need an app or stored variable to send the result (return) value?
I mean in your work around I could be happy if just I could put “_add as manu as you need” directly as the return value
that would be enough, but it’s not working (at least not working for me)
POST1: I have been testing this and I think we can asume the parameter variables are READ ONLY and because of that you can not use them to operate or to return a result
O M G !!!
1st: thanks 4 your time, really
2nd: now I’m super confused… it works in the Screen1.Opens but not if fired from a Button1.Click. What a headache!
I Totally agree with you, the app variables solution will soon lead to a complete mess.
My project is reaching a critical size and I am getting more and more anxious about using variables, leading me to create more variables which further makes me loose any kind of overview.
The fact that we have no scope concept and that everything is live everywhere is a limitator to how far you can take thunkable. If thunkable want to grow out of it’s teens we need to be able to scope variables…