mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
fix: {.set table.} duplicating keys instead of updating values
This commit is contained in:
parent
9220d33aa4
commit
cba235c7b0
@ -660,8 +660,11 @@ var
|
|||||||
|
|
||||||
procedure inc_(v:integer=+1);
|
procedure inc_(v:integer=+1);
|
||||||
begin
|
begin
|
||||||
|
try
|
||||||
|
setVar(p, intToStr(strToIntDef(getVar(p),0)+v*parI(1,1)));
|
||||||
result:='';
|
result:='';
|
||||||
try setVar(p, intToStr(strToIntDef(getVar(p),0)+v*parI(1,1))) except end;
|
except
|
||||||
|
end;
|
||||||
end; // inc_
|
end; // inc_
|
||||||
|
|
||||||
procedure convert();
|
procedure convert();
|
||||||
@ -1367,19 +1370,20 @@ var
|
|||||||
if not satisfied(space) then exit;
|
if not satisfied(space) then exit;
|
||||||
// set the table variable as text
|
// set the table variable as text
|
||||||
v:=par(1);
|
v:=par(1);
|
||||||
space.values[p]:=nonEmptyConcat('', space.values[p], CRLF)+v;
|
|
||||||
// access the table object
|
// access the table object
|
||||||
i:=space.indexOfName(p);
|
i:=space.indexOfName(p);
|
||||||
h:=space.objects[i] as THashedStringList;
|
if i < 0 then
|
||||||
if h = NIL then
|
|
||||||
begin
|
begin
|
||||||
h:=ThashedStringList.create();
|
h:=ThashedStringList.create();
|
||||||
space.objects[i]:=h;
|
space.AddPair(p, v, h);
|
||||||
end;
|
end
|
||||||
|
else
|
||||||
|
h:=space.objects[i] as THashedStringList;
|
||||||
// fill the object
|
// fill the object
|
||||||
k:=chop('=',v);
|
k:=chop('=',v);
|
||||||
v:=macroDequote(v);
|
v:=macroDequote(v);
|
||||||
h.values[k]:=v;
|
h.values[k]:=v;
|
||||||
|
space.values[p]:=h.text;
|
||||||
end; // setTable
|
end; // setTable
|
||||||
|
|
||||||
procedure disconnect();
|
procedure disconnect();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user