Skip to main content
Inspiring
October 29, 2016
Question

Is this possible?

  • October 29, 2016
  • 1 reply
  • 272 views

Hi Folks,

I'm working on a project and have had an unusual request. The client wants to achieve the following functionality.  I know I can do this with Conditional Actions and two buttons but is there a way to achieve this with a single button at the end using the "assign" function to "Display Total" then use a button to add the Display Total numbers to achieve the final number.  Basically I want the student to add numbers and have them automatically sum and display in the Display total then I want to add the display totals with a button. Is this possible or will I need to use two buttons?

    This topic has been closed for replies.

    1 reply

    Lilybiri
    Legend
    October 29, 2016

    Your question is not totally clear to me.  WHy would you need two buttons, and even a conditional action? How are the individual numbers stored, or are those literals? You will need at least 4 user variables:

      v_total1  which will store the result of the first sum

      v_total2 for the second total

      v_total3 for the third total

      v_totalEnd for the big sum

    Those variables can be inserted in one or more text containers and will show the result after the calculstaions in one standard action:

       Expression   v_total1 = 1 + 1       or the names of the variables if you do not use literals 

       Expression   v_total1 = v_total1 + 0

       Expressiosn v_total2 = 2 + 1

       Expression v_total2 = v_total2 + 0

       Expression v_total3 = 1 + 1

       Expression v_total3 = v_total3 + 0

       Expression v_totalEnd = v_total1 + v_total2

       Expression v_totalEnd = v_totalEnd + v_total3

    Only sequence is important, I don't see any reason to use a conditional action her


    +          

    Inspiring
    October 29, 2016

    Hi Lilybiri,

    Thanks for this. My original question was a little ambiguous. What I want to do is have the user insert numbers in the top box and have them add and subtotal in the Display Total without pressing any button?

    I was wondering if this is possible using a the "increment" or "assign" actions/functions. I've seen others have variables displayed as they are typed,  but not necessarily added. I suspect I can't  but I thought I would check here just in case.

    Ideally the student would input numbers into top boxes, they would combine and display in the Display Totals and then I would use a button to calculate the final total of the three Display Totals.

    Does that make sense?

    Cheers,

    Steve  

    Lilybiri
    Legend
    October 29, 2016

    No, that is not possible. Each action has to be triggered by an event. You cannot use a character as shortcut to replace Submit for the Text Entry Boxes (where you enter the numbers) because you don't know which number will be used. You need at least one Submit button to trigger that advanced action which will calculate all totals.