Hello,
I just figured out that you cannot use a global variable from a module in a calculation of the main solution. Is this supposed to be like that? If yes, I will have some work to do…
Thanks
Patrick
Hello,
I just figured out that you cannot use a global variable from a module in a calculation of the main solution. Is this supposed to be like that? If yes, I will have some work to do…
Thanks
Patrick
Could someone comment on this? I am using it all over the place and I need to know if this is expected behaviour or a bug.
Thanks!
Patrick
patrick:
i got my self in quite a bit of trouble doing this sort of thing;
at one time, i wanted to count how many times a particular
calc was getting called, so i created a global variable, and
set it to zero on solution startup. then, in the calc, i incremented
the variable. after that, servoy locked up and i had to crash
out of it!
it looks like just about anything you do that changes data causes
calcs to fire, and changing a global variable is one of these cases.
so a calc that changes a global will cause all calcs to fire, and
could get you in trouble.
my experience with calcs has been bad (or, one could say, my
understanding and usage of calcs has been bad). i tried
to use them everywhere for all sorts of things, and got burned
on performance. my new philosophy on calcs is to only use them
for very simple tasks, and don’t change anything while in the calc,
as you might end up in a loop.
Hello Robert,
my experiences with calcs are pretty good, especially since Johan improved their calls. I am not doing what you described. I just set a global to something and use that value in a calculation.
My problem is: the global sits in a module and the calc sits in the solution. This kind of setup simply returns nothing and I wonder why. I don’t think it should be that way…
I found the problem. Globals in Calcs DO WORK, not matter where the globals reside. But if the form, that shows the globals, has ZERO records, then you don’t see anything.
ah, i ran into something like that receintly; i have a few
calcs on a form, where the user can enter some info, and
the calcs display things related the the user’s input;
the problem is, the input fields on this form are globals,
so if there’s no current record, the calcs don’t fire.