Expand my Community achievements bar.

SOLVED

If / then syntax

Avatar

Level 1

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?

1 Accepted Solution

Avatar

Correct answer by
Level 10

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!

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

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!

Avatar

Level 1

Magus069

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

Thanks

Avatar

Level 10

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