2 Replies Latest reply on Aug 2, 2011 2:04 PM by bcs9966

    Syntax for If statement

    bcs9966

      I am trying to develop my first form using FormCalc. Line 1 reads:

      "if (OfferPrice.rawValue < 300000) then InitialDeposit.rawValue = 5000 elseif (OfferPrice.rawValue > 299999) then InitialDeposit.rawValue = 10000;" (without the quotes)

       

      It won't work and I am told the error is at various places each time I check the syntax. Help - If I can't do something this simple I think I will shoot myself. The names are correct and I have this under "calculate". And to think, I used to program in APL and Cobol

        • 1. Re: Syntax for If statement
          pguerett Level 6

          You didn't end your if statement..if shoudl be like this:

           

          if (OfferPrice.rawValue < 300) then
          InitialDeposit.rawValue = 5000
          elseif
          (OfferPrice.rawValue > 299) then
            InitialDeposit.rawValue = 10000
          endif

          • 2. Re: Syntax for If statement
            bcs9966 Level 1

            Thank you.

            I guess that is what happens when you decide to try and use skills you developed 35 years ago on an IBM 370 in CMS and went on to higher paid things 5 years later or maybe it is that I am 70 and my mind wanders.

             

            Peter Luttmer

            “Ever stop to think and then forget to start again?”

             

            You didn't end your if statement..if shoudl be like this:

             

            if (OfferPrice.rawValue < 300) then

            InitialDeposit.rawValue = 5000

            elseif

            (OfferPrice.rawValue > 299) then

              InitialDeposit.rawValue = 10000

            endif