Expand my Community achievements bar.

BMI syntaxis error near token 'then' on line 1, column 38

Avatar

Level 1

I use first this one

BMI.rawValue

= (WT.rawValue)*703/((HT.rawValue*HT.rawValue))

but I have this error

Script failed (language is formcalc; context is xfa[0].form[0].F[0].#subform[1].BMI[0]) script=(Weight*703)/Height*Height)

Error: arithmetic over/underflow.

I check the error on this forum and replace for this formula

BMI.rawValue

= if( HT.rawValue >0) then (WT.rawValue)*703/((HT.rawValue*HT.rawValue))

but not I have this error:

   script failed (lenguage is formcalc; context is xfa[0].form1[0].#subform[0].BMI[0])

  script=BMI.rawvalue=if(ht.rawvaule>0) then

(wt.rawvalue)*703/(HT.rawvaule*Ht.rawvalue)

Error:syntax error near token 'then' one line, column 38.

please help me.

4 Replies

Avatar

Level 1

Hi, I resolved my problem

the instruction is the follow form

= if( HT.rawValue >0) then (WT.rawValue)*703/((HT.rawValue*HT.rawValue))

I don't need put the filed to give the new value becasue I am on thefield.

thank you

Avatar

Level 1

I´ve tried your BMI formula (im using international units system so no conversion steps in the formula, BMI= weight (kilograms)/Height*height (meters)) but without any success I get the following error:

form1.#subform[4].IMC::calculate - (FormCalc, client)

if ( HT.rawValue >0) then (WT.rawValue)/((HT.rawValue*HT.rawValue))

syntaxis error near token ')' on line 3, near column 66

Can anyone help me to get this formula working?

Avatar

Former Community Member

You need an endif at the end of the statement. I prefer to write it diffierently (makes it easier to read).

if ( HT.rawValue >0) then

     (WT.rawValue)/(HT.rawValue*HT.rawValue)

endif

Hope that helps

Paul

Avatar

Level 1

Paul thank you very much! It worked! I got a migraine yesterday from this! Thaks again!