If / then syntax

Avatar

Avatar

jasonb44018069

Avatar

jasonb44018069

jasonb44018069

14-08-2015

I am struggling to understand how the "column" is identified in the syntax error. Regardless, this is what I have as scripting and am unable to identify the scripting error

if LoanAmount.rawValue = (FranchiseFee.rawValue + Buildout.rawValue + EMR.rawValue) then

   PostTotalExpense.rawValue = PostExpense.rawValue + PostSalary.rawValue + LoanPayment.rawValue + PostRent.rawValue + PostUtilities.rawValue + PostMedical.rawValue + Royalty.rawValue + Marketing.rawValue + PostBilling.rawValue;

elseif LoanAmount.rawValue < (FranchiseFee.rawValue + Buildout.rawValue + EMR.rawValue) then

   PostTotalExpense.rawValue = PostExpense.rawValue + PostSalary.rawValue + ((FranchiseFee.rawValue + Buildout.rawValue + EMR.rawValue)- LoanAmount.rawValue) + PostRent.rawValue + PostUtilities.rawValue + PostMedical.rawValue + Royalty.rawValue + Marketing.rawValue + PostBilling.rawValue;

elseif LoanAmount.rawValue = 0 then

    PostTotalExpense.rawValue = PostExpense.rawValue + PostSalary.rawValue + (FranchiseFee.rawValue + Buildout.rawValue + EMR.rawValue) + PostRent.rawValue + PostUtilities.rawValue + PostMedical.rawValue + Royalty.rawValue + Marketing.rawValue + PostBilling.rawValue;

endif

The error I am getting is

Error: syntax error near token 'LoanAmount' on Line 1 column 13

Any Thoughts?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Magus069

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

132

Correct Answer

150
Magus069
MVP

14-08-2015

hi there

I hope you are using formcalc for this, because it would not be good if you are using javascript...

anyhow in formcalc the "="should not be use in an if statement it should be replaced by "eq" just like "<" it should be replaced by "lt"

also, never forget to put the brackets for the if statement, it is the issue here... look at the following code

Hope this help!

Answers (2)

Answers (2)

Avatar

Avatar

Magus069

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

132

Correct Answer

150

Avatar

Magus069

MVP

Total Posts

(val/1000)?string[".0"]}K

Likes

132

Correct Answer

150
Magus069
MVP

14-08-2015

No problem,

here is a PDF on FormCalc reference , this could be very useful to you

http://help.adobe.com/en_US/livecycle/es/FormCalc.pdf

Avatar

Avatar

jasonb44018069

Avatar

jasonb44018069

jasonb44018069

14-08-2015

Magus069

You are correct that is was in formcalc.  Thanks for the direction. That fixed the problem!  Awesome!

Thanks