


I cannot seem to get past this error. I have looked at the forums and still am getting either a script syntax error or the aritmetic error, depending on which way I change the script
Here is my script: (FormCalc)
if(NumericField1 ne 0 & HasValue(NumericField1)) then (NumericField1*NumericField12)elsenullendif
I am trying to multiply 2 fields and then all the multiplied fields are totaled - very simple "spreadsheet" function. Can anyone tell me what I am doing wrong??
Thank you!!
MelissaP509
Views
Replies
Sign in to like this content
Total Likes
I will guess your script is in the "calculate" event of a 3rd field.
You can add a bit more in the script to try to help you understand the error.
For information: Overflow means it calculated a value too large to handle and underflow means it calculated a value too small to handle. Either case suggests something is wrong because I guess you have "every day" kind of values in the hundreds/thousands/millions kind of range.
Try the following [I slightly extended your 'if' so it requires a value in NumericField12 also] and it should pop up a window showing the values of both fields before the calculation:
// show field values for debugging
xfa.host.messageBox(
Concat("NumericField1 val: ", NumericField1, " NumericField12 val: ", NumericField12)
, null
, 3)
// calculate them
if(HasValue(NumericField1)
& HasValue(NumericField12)
& NumericField1 ne 0
& NumericField12 ne 0) then
NumericField1*NumericField12
else
null
endif
Good luck!
Views
Replies
Sign in to like this content
Total Likes