Cond

 

Purpose:

Allows to define conditions. The first parameter is a logical expression that will be evaluated as "True” of "False”. If the first expression is "True”, the second expression will be returned as the result. If the expression is "False”, the third expression will be returned as the result. If no third expression is entered, the return value will assume the following standard values, dependent upon its type:

2. Argument Type

Return value if expression = False

Boolean

False

String

"" (empty String)

Date

Julian Date value 0

Number

0

Picture

"" (empty String)

Barcode

"" (empty String)

 

Parameter:

Boolean

All

All                   (optional) The third parameter must be the same type as the second parameter.

Return value:

All

Example:

Cond(COUNTRY<>"USA",COUNTRY_LONG)

Cond(PRICE=0,"on request",Str$(PRICE,0,2))

Cond(empty(COMPANY),SALUTATION,COMPANY)