Internet Direct (Indy) Version 9.0.2 Beta
iif
Returns a value based on a conditional expression.

function iif(const ATest: Boolean; const ATrue: Integer; const AFalse: Integer): Integer;
function iif(const ATest: Boolean; const ATrue: string; const AFalse: string): string;
Parameters
const ATest: Boolean
Conditional expression to be tested.

const ATrue: Integer
Value to return when the expression is True.

const AFalse: Integer
Value to return when the expression is False.

Returns
Integer - Return value for the evaluated conditional expression.

String - Return value for the evaluated conditional expression.

Description
Iif is an overloaded function that provides return values specified in ATrue and AFalse based on the conditional test expression in ATest. When ATest evaluates to True, then the return value in ATrue is used. When ATest evaluates to False, then return value in AFalse is used. Iif is overloaded to allow use of Integer and String return values.