Conditionally returns one of two specified values.
function IfThen(Cond: Boolean; TrueRes: integer; FalseRes: integer): integer;
ecSysUtils
Functions