IDE, EditorMacro: fix parsing of arguments. Fix numbers and #123

git-svn-id: branches/fixes_1_8@57809 -
This commit is contained in:
mattias 2018-05-07 18:14:38 +00:00
parent c1ffcb07ab
commit 42dba03d94

View File

@ -868,7 +868,7 @@ begin
SkipNum(i);
SetLength(FParams, c + 1);
FParams[c].ParamType := ptInteger;
FParams[c].Num := StrToInt(copy(FText, i, j-i));
FParams[c].Num := StrToInt(copy(FText, j, i-j));
inc(c);
end
else
@ -877,10 +877,17 @@ begin
s := '';
repeat
case FText[i] of
' ',#9,#10,#13: inc(i);
'+': begin
inc(i);
if not (FText[i] in ['''', '#']) then exit(AddError('Expected string or char after +'));
end;
'#': begin
inc(i);
j := i;
SkipNum(i);
k := StrToInt(copy(FText, i, j-i));
if i = j then exit(AddError('Expected number in string after #'));
k := StrToInt(copy(FText, j, i-j));
if k > 255 then exit(AddError('Argument to long'));
s := s + chr(k);
end;