Unknown 7 éve
szülő
commit
de4ac60dd0
1 módosított fájl, 14 hozzáadás és 0 törlés
  1. 14 0
      Quick.Commons.pas

+ 14 - 0
Quick.Commons.pas

@@ -190,6 +190,8 @@ type
   function IsSameDay(cBefore, cNow : TDateTime) : Boolean;
   //returns n times a char
   function FillStr(const C : Char; const Count : Byte) : string;
+  //checks if string exists in array of string
+  function StrInArray(const aValue : string; const aInArray : array of string) : Boolean;
   //returns a number leading zero
   function Zeroes(const Number, Len : Int64) : string;
   //converts a number to thousand delimeter string
@@ -520,6 +522,18 @@ begin
   for i := 1 to Count do Result := Result + C;
 end;
 
+
+function StrInArray(const aValue : string; const aInArray : array of string) : Boolean;
+var
+  s : string;
+begin
+  for s in aInArray do
+  begin
+    if s = aValue then Exit(True);
+  end;
+  Result := False;
+end;
+
 function Zeroes(const Number, Len : Int64) : string;
 begin
   if Len > Length(IntToStr(Number)) then Result := FillStr('0',Len - Length(IntToStr(Number))) + IntToStr(Number)