Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

If / then syntax

jasonb44018069
Level 1
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
Magus069
Correct answer by
Level 10
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
Magus069
Correct answer by
Level 10
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

jasonb44018069
Level 1
Level 1

Magus069

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

Thanks

Magus069
Level 10
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