Browse Source

* Another missing func (bug 7678) ifthen(string)

git-svn-id: trunk@5031 -
marco 19 years ago
parent
commit
0e7763b0e5
1 changed files with 7 additions and 0 deletions
  1. 7 0
      rtl/objpas/math.pp

+ 7 - 0
rtl/objpas/math.pp

@@ -480,6 +480,7 @@ function norm(const data : PExtended; Const N : Integer) : float;
 function ifthen(val:boolean;const iftrue:integer; const iffalse:integer= 0) :integer; {$ifdef MATHINLINE}inline; {$endif}
 function ifthen(val:boolean;const iftrue:int64  ; const iffalse:int64 = 0)  :int64;   {$ifdef MATHINLINE}inline; {$endif}
 function ifthen(val:boolean;const iftrue:double ; const iffalse:double =0.0):double;  {$ifdef MATHINLINE}inline; {$endif}
+function ifthen(val:boolean;const iftrue:String ; const iffalse:String ='') :String;  {$ifdef MATHINLINE}inline; {$endif}
 
 function CompareValue ( const A, B  : Integer) : TValueRelationship; inline;
 function CompareValue ( const A, B  : Int64) : TValueRelationship; inline;
@@ -2089,6 +2090,11 @@ begin
   if val then result:=iftrue else result:=iffalse;
 end;
 
+function ifthen(val:boolean;const iftrue:String ; const iffalse:String ='') :String;  {$ifdef MATHINLINE}inline; {$endif}
+begin
+  if val then result:=iftrue else result:=iffalse;
+end;
+
 // dilemma here. asm can do the two comparisons in one go?
 // but pascal is portable and can be i inline;ed. Ah well, we need purepascal's anyway:
 function CompareValue ( const A, B  : Integer) : TValueRelationship; 
@@ -2150,4 +2156,5 @@ end;
 {$endif}
 
 
+
 end.