1 Reply Latest reply on Jan 4, 2013 9:02 AM by raybaudi

    using global variables in a set variable

    FredGross

      Title

      using global variables in a set variable

      Post

           I have a script where I set a global variable $$total to one value and the depending upon an if statement I want to add the value of a field variable to the previous global variable $$total and reassign the new total back to the same $$total.  How might this be done?

           What I have now is:

           set variable [$$total; value: 0]

           if [ test1]

             set variable [$$total; value (( table::cost1) + (table::cost2))]

           end if

           if [test2]

             set variable [$$total; value ((table::cost3) + $$total)]

           end if

            

           It behaves correctly when only test1 or test2 is true.  If test1 is true and test2 is also true then $$total = cost3.  I want $$total = cost1 + cost2 +cost3 if both tests are true.