basic if statement in formcalc..
I'm trying to create basic if statement for one of the fields. I'd like to know your opinion what is wrong with it
//code
form1.#subform[0].Body.TotalTaken[0]::calculate - (FormCalc, client)
var sum = Sum(Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)
// if I leave only Sum(Jan,...) in this field it works fine, shows the sum...
if (this.rawValue > 0 && TotalAvailable.rawValue <= sum)
this.rawValue = sum
else
this.rawValue = 1
endif
//endofcode
Im trying to do basic validation, if sum is between 0 and Total Available number then its ok, display the sum, other wise dosplay some popup, at the moment I want only "1" to be shown since I cant pass even that basic scripts.
I get an error "near token &". It doesnt matter if I switch "this" with field name, "TotalAvailable". All fields are numeric of same type.
Please advice.