fix getLineFromDmdMessage doesnt work with -vcolumns

This commit is contained in:
Basile Burg 2014-08-19 09:25:08 +02:00
parent 4fc2e25293
commit ddb671e8a1
1 changed files with 10 additions and 4 deletions

View File

@ -508,10 +508,9 @@ begin
end; end;
end; end;
//TODO-cbugfix: doesnt work with -vcolumns
function getLineFromDmdMessage(const aMessage: string): TPoint; function getLineFromDmdMessage(const aMessage: string): TPoint;
var var
i: NativeInt; i, j: NativeInt;
ident: string; ident: string;
begin begin
result.x := 0; result.x := 0;
@ -533,7 +532,7 @@ begin
begin begin
inc(i); inc(i);
if i > length(aMessage) then exit; if i > length(aMessage) then exit;
while( isNumber(aMessage[i]) ) do while( isNumber(aMessage[i]) or (aMessage[i] = ',')) do
begin begin
ident += aMessage[i]; ident += aMessage[i];
inc(i); inc(i);
@ -541,7 +540,14 @@ begin
end; end;
if aMessage[i] = ')' then if aMessage[i] = ')' then
begin begin
result.y := strToIntDef(ident, -1); j := Pos(',', ident);
if j = 0 then
result.y := strToIntDef(ident, -1)
else
begin
result.y := strToIntDef(ident[1..j-1], -1);
result.x := strToIntDef(ident[j+1..length(ident)], -1);
end;
exit; exit;
end; end;
end; end;