IF EXPRESSION … END IF

Top  Previous  Next

Syntax

 

if expression

end if

 

 

Description

 

The if expression block test evaluates the expression as Basic syntax to determine if the enclosed UnForm rule set commands should be included in the current job.

 

Before 9.0, this expression could only reference values available at parse time, not runtime, so expressions could only evaluate prm() or gbl() functions, or uf.xxx variables that would contain command line settings.  Starting in 9.0, however, the expressions are generally evaluated at runtime, allowing output commands like text, box, and image to be conditionally resolved during document production.

 

Some commands must be resolved at parse time, such as merge and const/global/local, however, so expressions that contain prm(), gbl(), or uf.xxx are still resolved at parse time.

 

end if indicates that conditional processing of the rule set is done, and normal parsing continues. The end if keyword may also be entered as endif or fi.

 

 

Examples

 

if uf.pdftitle$=""

 title "Default Title"

end if

 

if prm("email")>""

 # command line contained -prm email=xxx

 email {prm("email")},...

end if

 

Drivers: pcl, pdf, ps, zebra