In the function TUIBSQLParser.GetStatement there is an error in a cycle condition.
The FLine variable is equal to FStrings.Count, not FStrings.Count - 1.
How to fix:
Add a new variable
EndLine = FLine - 1
and to use it instead of FLine.
Source code (before fix):
<code>
function TUIBSQLParser.GetStatement: string;
var
i: integer;
str: string;
begin
result := '';
for i := FMarkerLine to FLine do
begin
str := FStrings[i];
if (FMarkerLine = FLine) then
Result := copy(str, FMarkerPos +1, FCursor - PChar(FStr) - FMarkerPos ) else
if (FMarkerLine = i) then
Result := copy(str, FMarkerPos + 1, Length(Str) - FMarkerPos) else
if i <> FLine then
Result := Result + #13#10 + str else
Result := Result + #13#10 + copy(str, 0, FCursor - PChar(FStr))
end;
end;
</code>
Result code (after fix):
<code>
function TUIBSQLParser.GetStatement: string;
var
i: integer;
str: string;
EndLine: Integer;
begin
result := '';
EndLine := FLine - 1;
for i := FMarkerLine to EndLine do
begin
str := FStrings[i];
if (FMarkerLine = EndLine) then
Result := copy(str, FMarkerPos +1, FCursor - PChar(FStr) - FMarkerPos ) else
if (FMarkerLine = i) then
Result := copy(str, FMarkerPos + 1, Length(Str) - FMarkerPos) else
if i <> EndLine then
Result := Result + #13#10 + str else
Result := Result + #13#10 + copy(str, 0, FCursor - PChar(FStr))
end;
end;
</code>
This has not been applied to SVN trunk as yet (see the date of this post); could someone do that please.
This is my ticket (I registered again).
this ghost house is abandoned long ago
try https://github.com/hgourvest/uib/commits/master