Expand my Community achievements bar.

Script Error "missing or illegal parameters"

Avatar

Former Community Member

I am trying to write a script in formcalc calculates the present value based on an age. So I have to do a conditional statement that includes the present value calculation. I keep getting this "missing or illegal parameters" error, and according to the adobe manual, I'm putting the values in the correct order. Here is a screen shot of my error:

Error.jpg

Where "Table1.Row3.age" is age, "I31" is the present value, "Row1.I29" is the monthly payment, "NumericField1" is the interest rate, and then depending on the age there is a different time frame.

Does anyone know what parameters are causing this error?

Thanks,

3 Replies

Avatar

Level 10

The script looks ok so far.

Maybe one of the parameters is not a numeric value or 0.

The manual states:

Avatar

Former Community Member

I have been battling this stupid script for a month now and still have the same problem. I really can't see where the issue is, but it still comes up with "missing or illegal parameters". This is my script:

if (form1.#subform[0].Table1.Row3.age<45) then form1.#subform[0].Table2.Row2[1].I31=0

elseif (form1.#subform[0].Table1.Row3.age==45) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.62*12)

elseif (form1.#subform[0].Table1.Row3.age==46) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.66*12)

elseif (form1.#subform[0].Table1.Row3.age==47) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.69*12)

elseif (form1.#subform[0].Table1.Row3.age==48) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.73*12)

elseif (form1.#subform[0].Table1.Row3.age==49) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.77*12)

elseif (form1.#subform[0].Table1.Row3.age==50) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.81*12)

elseif (form1.#subform[0].Table1.Row3.age==51) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.86*12)

elseif (form1.#subform[0].Table1.Row3.age==52) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.9*12)

elseif (form1.#subform[0].Table1.Row3.age==53) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.95*12)

elseif (form1.#subform[0].Table1.Row3.age==54) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.01*12)

elseif (form1.#subform[0].Table1.Row3.age==55) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.07*12)

elseif (form1.#subform[0].Table1.Row3.age==56) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.13*12)

elseif (form1.#subform[0].Table1.Row3.age==57) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.21*12)

elseif (form1.#subform[0].Table1.Row3.age==58) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.3*12)

elseif (form1.#subform[0].Table1.Row3.age==59) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.39*12)

elseif (form1.#subform[0].Table1.Row3.age==60) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.5*12)

elseif (form1.#subform[0].Table1.Row3.age==61) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.61*12)

elseif (form1.#subform[0].Table1.Row3.age==62) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.74*12)

elseif (form1.#subform[0].Table1.Row3.age==63) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.88*12)

elseif (form1.#subform[0].Table1.Row3.age==64) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 19.04*12)

elseif (form1.#subform[0].Table1.Row3.age==65) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 19.21*12)

elseif (form1.#subform[0].Table1.Row3.age==66) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 18.4*12)

elseif (form1.#subform[0].Table1.Row3.age==67) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 17.6*12)

elseif (form1.#subform[0].Table1.Row3.age==68) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 16.82*12)

elseif (form1.#subform[0].Table1.Row3.age==69) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 16.05*12)

elseif (form1.#subform[0].Table1.Row3.age==70) then form1.#subform[0].Table2.Row2[1].I31=PV(form1.#subform[0].T11, form1.#subform[0].NumericField1/12, 15.29*12)

elseif (form1.#subform[0].Table1.Row3.age>70) then form1.#subform[0].Table2.Row2[1].I31=0 endif

None of the parameters would ever equal zero; however, the interest rate is a user-input field, so I don't know if maybe that's the problem? But, regardless, I really can't see what is wrong and how to fix it.

I need some help really bad on this!

Avatar

Level 2

Hi,

Did you ever get any help with this or figure it out? I'm going nuts with the present value formula.

I got some help in figuring out I had things in the wrong order, but now my problem is that the amount value (in my case a rent value) multiplies exponentially larger rather than growing smaller.

In the Excel formula I was working from, it used a negative amount value -- which I can't do with this formula.  If you have cracked the code on this (literally!) I would be most grateful to learn from you.

Thank you!

Shu