There is an error in the implementation of the function uROClasses.EndsWith for NEXTGEN compilers.
It does not take into account that strings for these compilers are zero based.
The correct implementation for this function should be:
function EndsWith(const iSubStr,iString:string;aCaseInsensitive: Boolean =False):boolean;
var
Len,Len2,i:integer;
lSubstr, lString: string;
begin
if aCaseInsensitive then begin
lSubstr := AnsiUpperCase(iSubStr);
lString := AnsiUpperCase(iString);
end
else begin
lSubstr := iSubStr;
lString := iString;
end;
//ToDo -cOptimize: optimize, like we did with StartsWith
Len := _StrHigh(lSubStr);
Len2 := _StrHigh(lstring);
if Len <= Len2 then begin
for i := _StrLow to Len do begin;
{$IFDEF NEXTGEN}
if lSubStr[Len-i] <> lstring[Len2-i] then begin
{$ELSE}
if lSubStr[Len-i+1] <> lstring[Len2-i+1] then begin
{$ENDIF}
result := false;
exit;
end
end;
result := true;
end
else begin
result := false;
end;
end;