# global calculation?

**URL:** <https://forum.servoy.com/t/global-calculation/3156>\
**Category:** Classic Servoy\
**Created:** [November 27, 2004, 5:40pm UTC](https://forum.servoy.com/t/global-calculation/3156 "2004-11-27T17:40:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)\
**Post date:** [November 27, 2004, 5:40pm UTC](https://forum.servoy.com/t/global-calculation/3156/1 "2004-11-27T17:40:16Z")

</div>

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! ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [November 29, 2004, 5:05pm UTC](https://forum.servoy.com/t/global-calculation/3156/2 "2004-11-29T17:05:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Cain](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@Cain](https://forum.servoy.com/u/Cain)\
**Post date:** [November 29, 2004, 5:30pm UTC](https://forum.servoy.com/t/global-calculation/3156/3 "2004-11-29T17:30:35Z")

</div>

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)]( "Cool")
