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

If expression help

swim4serio
Registered: Oct 9 2009
Posts: 13

I am trying to create a billing report.
I have two drop down boxes (Travel_Zone & Assignment_Type) that contribute to a numeric field which will be calculated.

I know that I can script

if ( Travel_Zone == 0 ) then
92 else
0
endif

but I would like to have both drop-down boxes be included in the if states, i.e.

if ( Travel_Zone == 0 ) and ( Assignment_Type == 0) then
92 else
0
endif

but I receive an error that the "and" is causing an issue. Any ideas?

My Product Information:
LiveCycle Designer, Windows
swim4serio
Registered: Oct 9 2009
Posts: 13
Resolved

if ( Travel_Zone == 0 and Assignment_Type == 0 ) then
92 else
0
endif
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
You have not created a logical statement that results in a single value that is evaluated by the if statement.

If you are going to use multiple condition statements for an single if, all of the individual logical statements need to be within evaluated need to result is a single value for the if statement

var bTest = Travel_Zone == 0 and  Assignment_Type == 0if ( bTest ) then92 else0endif

or restated as

if ( Travel_Zone == 0 and Assignment_Type == 0 ) then92 else0endif

George Kaiser

swim4serio
Registered: Oct 9 2009
Posts: 13
Not Resolved:

if ( Travel_Zone == 0 and Assignment_Type == 0 ) then
92
elseif ( Travel_Zone == 1 and Assignment_Type == 0 ) then
97
elseif ( Travel_Zone == 2 and Assignment_Type == 0 ) then
99
elseif ( Travel_Zone == 3 and Assignment_Type == 0 ) then
110
elseif ( Travel_Zone == 4 and Assignment_Type == 0 ) then
120
elseif ( Travel_Zone == 0 and Assignment_Type == 1 ) then
115
elseif ( Travel_Zone == 1 and Assignment_Type == 1 ) then
125
elseif ( Travel_Zone == 2 and Assignment_Type == 1 ) then
135
elseif ( Travel_Zone == 3 and Assignment_Type == 1 ) then
150
elseif ( Travel_Zone == 4 and Assignment_Type == 1 ) then
160
elseif ( Travel_Zone == 0 and Assignment_Type == 2 ) then
185
elseif ( Travel_Zone == 1 and Assignment_Type == 2 ) then
195
elseif ( Travel_Zone == 2 and Assignment_Type == 2 ) then
205
elseif ( Travel_Zone == 3 and Assignment_Type == 2 ) then
225
elseif ( Travel_Zone == 4 and Assignment_Type == 2 ) then
235
else
0
endif

but will only display first travel zone rates
swim4serio
Registered: Oct 9 2009
Posts: 13
Any clues for multiple variable tests?
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
It works for me in LiveCycle Designer and Acrobat.

George Kaiser

swim4serio
Registered: Oct 9 2009
Posts: 13
I was not applying values to Assignment_Type, but thanks for the help earlier.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4308
If you use the calculation for the text or decimal field's calculation, it works.

George Kaiser