ScriptCore3.iif
function iif(Condition: Boolean; IfTrue, IfFalse: Variant): Variant Condition: TRUE or FALSE value. IfTrue: Variable which shall be returned if (Condition) is TRUE IfFalse: Variable which shall be returned if (Condition) is FALSE
Description
This function acts the same as a normal IF statement, however it may be used inline.
Example
var
MyCondition: boolean;
MyInt: integer;
begin
MyInt := 5942;
WriteLn('The condition is currently '+iif(MyCondition,'true','false')); //The condition is currently false
MyCondition := true;
WriteLn('The condition is currently '+iif(MyCondition,'true','false')); //The condition is currently true
WriteLn('The condition is currently '+iif(MyInt > 6000,'true','false')); //The condition is currently false
MyInt := 8468;
WriteLn('The condition is currently '+iif(MyInt > 6000,'true','false')); //The condition is currently true
end;