Browse Source

[commons] delphi XE4 compatibility

Exilon 5 years ago
parent
commit
265b9cfd48
1 changed files with 14 additions and 1 deletions
  1. 14 1
      Quick.Commons.pas

+ 14 - 1
Quick.Commons.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Version     : 1.9
   Created     : 14/07/2017
-  Modified    : 14/03/2020
+  Modified    : 22/03/2020
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
@@ -1609,12 +1609,25 @@ end;
 function TArrayOfStringHelper.Remove(const aValue : string) : Boolean;
 var
   i : Integer;
+  {$IFNDEF DELPHIXE7_UP}
+  n : Integer;
+  len : Integer;
+  {$ENDIF}
 begin
   for i := Low(Self) to High(Self) do
   begin
     if CompareText(Self[i],aValue) = 0 then
     begin
+      {$IFDEF DELPHIXE7_UP}
       System.Delete(Self,i,1);
+      {$ELSE}
+      len := Length(Self);
+      if (len > 0) and (i < len) then
+      begin
+        for n := i + 1 to len - 1 do Self[n - 1] := Self[n];
+        SetLength(Self, len - 1);
+      end;
+      {$ENDIF}
       Exit(True);
     end;
   end;