function TSheet.solve(c, r: integer): string;
var exp,sc:string;
i,p1,p2:integer;
begin
exp:=(HideGrid[c,r]);
if cells[c,r].formula then
begin
if cells[c,r].formula then delete(exp,1,1);
while letter(exp) do
for i:= 1 to (length(exp)-1) do
if isletter(exp[i]) then
begin
sc:='';
sc:=exp[i];
if isnumber(exp[i+1]) then
begin
sc:= sc + exp[i+1];
if ((i+2)<=length(exp)) then
if isnumber(exp[i+2]) then sc:= sc + exp[i+2];
if ((i+3)<=length(exp)) then
if isnumber(exp[i+3]) then sc:= sc + exp[i+3];
exp:=replace(exp, sc, solve(tradcol(sc), tradrow(sc), c, r));
end
else
if UpCase(exp[i]) = UpCase(parameter) then
begin
exp:=replace(exp, parameter, solve(Visualgrid.Col,visualgrid.Row,c,r));
end;
end;
exparser1.Expression.Clear;
exparser1.Expression.add(exp);
result:=exparser1.F([]);
end
else
begin
if cells[c,r].empty then result:='0';
if cells[c,r].data then result:=visualgrid.Cells[c,r];
end;
end;