Using Table based Maths on a screen

Solved a problem in an elegant manner and want to show off your code? Know a hard-to-find feature? Post it here for the benefit of others. Questions don't belong here.
Posts: 66
Joined: Tue Jan 10, 2012 2:48 pm
Been thanked: 1 time

Using Table based Maths on a screen

Post by SteampunkProfessor »

I'm still getting my head round using Tables, so I'm probably doing something stupid here.
I have a screen with a table on it and a couplke of Maths fields doing totals based on an option field in the Table. The Maths works fine but it's interferring with the update function in the Table. Any ideas as to how I stop this happening?

Posts: 44
Joined: Mon Mar 18, 2019 5:14 pm
Location: Preston
Has thanked: 1 time
Been thanked: 6 times

Re: Using Table based Maths on a screen

Post by ISimpson »

When you say interfering with updating what do you mean that the outcome of the maths item is not being displayed properly?

When you change data in a table then you will need to have made sure to have, once the calculations are done, probably a TABLEREFRESHSELECTED command to update the values on screen.

Posts: 467
Joined: Fri Jun 15, 2012 12:44 pm
Has thanked: 15 times
Been thanked: 47 times

Re: Using Table based Maths on a screen

Post by revellbikes »

Can you give some further background as to what you're hoping to achieve here?

It sounds like you're doing your calculations in your maths fields which reside on screen? When perhaps you should be driving the calculations on the update and save / delete buttons on the table?

If you've got table select commands within a maths field on a screen, every time the screen refreshes, i.e tabbing between fields (Unless you untick the right click option in screen designer - but that would still not work for your assumed requirements). So each time it runs it'll be performing table selects and confusing the screen view of the table.

As a rule always try and run code within a process rather than on screen (unless it's something simple like a total field that you want to update as you fill in values, or validation you want to change as you type)