RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
StrUtils.IfThen Function

Conditionally returns one of two specified values.

Pascal
function IfThen(AValue: Boolean; const ATrue: string; AFalse: string = ''): string; overload;
C++
AnsiString IfThen(Boolean AValue, const AnsiString ATrue, AnsiString AFalse = '');

StrUtils

IfThen checks the expression passed as AValue and returns ATrue if it evaluates to true, or AFalse if it evaluates to false. In Delphi, if the AFalse parameter is omitted, IfThen returns 0 or an empty string when AValue evaluates to False. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!