How to control multiply ontextchange

Hi all,

I created a simple application to calculate the total salt in the water, just a test. Here under the screen.

Using ontextchange event I want to change the value of “Salt percent” if the value of “Total Salt” is changed and change the value of “Total Salt” if the value of “Salt Percent” is changed too. As I want to do this in real time I built the follow blocks to do this :

But If I change any value the app enter in looping. I tried to use a Flag to control the change, but didn’t work.

Does anyone have any suggestions?

I didn’t understand it clearly please refer to textbox or label for text changing and explain it clearly it is confusing

Did you try to create a condition in the “on Change” of the total salt and generate a procedure to recalculate your total salt?

The problem is in recursion … What did try ? How did you make flag ?

Hi, Soham,

I’m talking about textbox, as I used ontextchanged event in the “Salt Percent” textbox to change the value of “Total Salt” textbox and the same event in the “Total Salt” textbox to change the value of “Salt Percent” textbox, both based “Water volume”, the app enter in looping.

Hi Rogerio, I used the follow blocks to try to control the change :

1 Like

The idea can be: check if the previous value is the same as the current one. It only allows you to enter the calculation and stay recursive, if different.

2 Likes

Thanks a lot Rogerio. You solved the problem. Here under the blocks :

2 Likes

Glad I helped you. !!!
P.S. Glad I managed to give you the idea. :+1: :smiley:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.