The NEW XpressDox Version 14 is now available!

Edit Content
Click on the Edit Content button to edit/add the content.

The IIf Function

This function is a kind of short cut to writing «If()»«Else()»  … «End()» in certain circumstances.

 

Using If.. Else.. End:

Suppose you want to write something like

The amount of VAT applicable is ….

Where the …. above is either zero, if no VAT is applicable, or is Amount * VatPercentage div 100.

Using the If command that would be:

The amount of VAT applicable is «If((VatApplicable = 'Yes')»«FormatAmount(Amount * VatPercentage div 100)»«Else()»0.00«End()».

 

Using IIf:

You could combine those all into one fillpoint like this:

The amount of VAT applicable is «IIf((VatApplicable = 'Yes'),FormatAmount(Amount * VatPercentage div 100),'0.00')».

 

This function, the Inline If, gets its name from the Basic language function which operates in a similar fashion.

 

Related articles:

Conditional processing

Learn more about conditional logic here.

 

Table of Contents