This repository was archived by the owner on May 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 60
60
Delete(URL, 1 , Pos(' ://' , URL) + 2 );
61
61
Result := GetURLFilePartRec(URL);
62
62
end ;
63
+
64
+ function CompareVersions (VerL, VerR: String): Integer;
65
+ var
66
+ VerLExplode: TStrings;
67
+ VerRExplode: TStrings;
68
+ i: Integer;
69
+ MinCount: Integer;
70
+ begin
71
+ Result := 0 ;
72
+ VerLExplode := SplitString(VerL, ' .' );
73
+ VerRExplode := SplitString(VerR, ' .' );
74
+
75
+ if VerLExplode.Count < VerRExplode.Count then begin
76
+ MinCount := VerLExplode.Count;
77
+ end else begin
78
+ MinCount := VerRExplode.Count;
79
+ end ;
80
+
81
+ for i := 0 to MinCount - 1 do begin
82
+ if StrToIntDef(VerLExplode[i], 0 ) < StrToIntDef(VerRExplode[i], 0 ) then begin
83
+ Result := 1 ;
84
+ exit;
85
+ end else if StrToIntDef(VerLExplode[i], 0 ) > StrToIntDef(VerLExplode[i], 0 ) then begin
86
+ Result := -1 ;
87
+ exit;
88
+ end ;
89
+ end ;
90
+ end ;
91
+
92
+ function GetLatestVersion (Versions: TArrayOfString): String;
93
+ var
94
+ i: Integer;
95
+ begin
96
+ Result := Versions[0 ];
97
+ for i := 0 to GetArrayLength(Versions) - 1 do begin
98
+ if CompareVersions(Result, Versions[i]) = 1 then
99
+ Result := Versions[i];
100
+ end ;
101
+ end ;
You can’t perform that action at this time.
0 commit comments