12 Replies
Kevin Thorn

HI Karel,

What Wendy said ^

I refer to this as "Set & Pass." To help think through your logic, remember that variable can only hold one value at a time. In order to get one variable's value into another we first have to set it and then pass it (add) to another variable. 

Wendy's solution demonstrates that concept exactly. 

  • SET: Adjust Variable [1A] equal to the typed value when the control loses focus
  • PASS: Adjust Variable [TotCol1] +Add (the value of) [1A] when the control loses focus
  • Rinse & Repeat the above two triggers for each Data Entry field in each column

In Wendy's example the Total variable will keep adding values as the user enters a value in each of the Data Entry fields. 

If you want the learner's to first enter values in all the fields and then click a button to add them all at once to the Total value, it would look like this:

  • SET: Adjust Variable [1A] equal to the typed value when the control loses focus
  • Rinse & Repeat the above trigger for each Data Entry field in column 1
  • Add a button for column 1 and add the below trigger to that button
  • PASS: Adjust Variable [TotalCol1] +Add (the value of) [1A] when the user clicks [button]
  • Rinse & Repeat the above trigger for each variable in column 1 and add to the button

That should do it!

Nathan Hartwick

This is great. I added a trigger to the button and moved it to the top of the trigger list which resets the TotCol1 or TotCol2 to 0 before adding the numbers together. This way you would only have a total for what is showing in the fields and not everything that has been entered if you made changes.