Hello,
In 60% of my coding I miss “local variables”. By local I mean a variable that is only declared withing a Form object.
We have only “method variables” and “global variables”
Anton
Hello,
In 60% of my coding I miss “local variables”. By local I mean a variable that is only declared withing a Form object.
We have only “method variables” and “global variables”
Anton
If you mean you miss a “form variable”, there is none. And if there was: where would you declare that?
Hello Patrick
where would you declare that?
The same way as the global variable is declared..?
Only one difference, it should follow the javascript datatypes!
Anton
anton, what you can do is just ‘use’ the variable without declaring it.
that way the variable is made global but you don’t have to declare them.
Just remember to set them to null when you leave the form and the variable is ‘gone’…
Cheers,
marcel
try playing with:
var x = 10;
and
y = 10;
in youre scripts.
You will see a difference.
Thanks Marcel and Johan,
Your sollution seems to work, but it doesn’t.
When you load the form in let’s say an tabpanel, everything is messed up bad.
So it’s not an advisable approach…
Anton
Can you please be more clear Anton. I use this frequently without issues so it should work…
I posted this request also.
Later I saw you had this request also
Hi Anton,
please have a look to this topic, think you’ll get some answers…
http://forum.servoy.com/viewtopic.php?t=8755
According to servoy, locals (form variables) may be introduced by version 4.
At that moment, we use a workaround, by defining a new property (private property) into the form object. We then stock information into that property. Hope this helps…