These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Code for finding result for 2 conditions

Techgrrl
Registered: Jul 16 2007
Posts: 8

I am about to lose my mind! Here's the deal. I have to have a form calculate conditions based on the following:

If (A >= A1 or B >= B1) then
Results1 = "Pass"

elseif

(A < A1 or B < B1) then
Results1 = "Fail"

I cannot quite get the 2 conditions to jive. If A is greater than or equal to A1 then I have no problem getting the Pass result. However is condition one is okay and condition 2 is not, B IS less than B1, I cannot get the results box to trigger a fail.

What am I missing?!

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
The syntax for the "if..." statement must end with an "endif' in FormCalc.

George Kaiser

Techgrrl
Registered: Jul 16 2007
Posts: 8
Sorry about that, I do have the endif.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
I would nest try using parenthesis to set the order of the evaluation and remove the redundant logical statement from the "eleif". Also use the message box to display some information about the comparisons to see what is going on:


$host.messageBox( Concat("A >= A1: ", (A >= A1), " B >= B1: " , (B >= B1) ), "Comparison Results" , 3)
$host.messageBox( Concat("A >= A1 or B >= B1: ", (A >= A1 or B >= B1) ), "Comparison Results or" , 3)If ( (A >= A1) or (B >= B1) ) then
Results1 = "Pass"
else
Results1 = "Fail"
endif

George Kaiser