lazarus-ccr/examples/germesorders/uutils.pas
MageSlayer 05a5e2c6a2 First public commit
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@639 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2008-12-21 21:46:28 +00:00

31 lines
799 B
ObjectPascal

unit uUtils;
{$mode objfpc}{$H+}
interface
function Iif(Cond:boolean; const TrueResult:String; const FalseResult:string):string;overload;
function Iif(Cond:boolean; const TrueResult:integer; const FalseResult:integer):integer;overload;
function IfEmpty(const S:String; const ThenReplace:string):string;
implementation
function IfEmpty(const S:String; const ThenReplace:string):string;
begin
if S = '' then Result:=ThenReplace else Result:=S;
end;
function Iif(Cond:boolean; const TrueResult:String; const FalseResult:string):string;overload;
begin
if Cond then Result:=TrueResult else Result:=FalseResult;
end;
function Iif(Cond:boolean; const TrueResult:integer; const FalseResult:integer):integer;overload;
begin
if Cond then Result:=TrueResult else Result:=FalseResult;
end;
end.