Page 1 of 1

global calculation?

PostPosted: Sat Nov 27, 2004 7:40 pm
by Cain
Is there any way to create a global calculation?

Scenario: I want to use the rowBGColorCalculation. For tables and lists, it will alternate colors, and highlight selected. For record views, I'd like to show a different color background of a global find flag is set (to let the user know s/he's in Find mode).

I can defind this calc for each and every table, but it's going to be the same calc.

This isn't a big problem, really, but from my experience thus far with Servoy, I thought I'd check to see if there's an easier way that I'm missing. Time and again, when I find myself doing the same thing over and over again in my programming, I find that it's because I'm not doing it the Servoy way! :)

PostPosted: Mon Nov 29, 2004 7:05 pm
by jcompagner
for rowBGColorer you need to make a calculation for every table.
But the implementation could be in a global method but this is NOT Supported!!

the calc can be something like this:

return globals.rowBGColorer();

and then you have a global method rowBGColorer that has the implementation.

PostPosted: Mon Nov 29, 2004 7:30 pm
by Cain
OK, this is actually what I'm doing now. It seems to work okay, and does save a lot of redundant code.

Glad to find out I'm not doing it the 'long way'. 8)