You can use a const in a function and wrap it in {$J+} to allow modifying consts. And that's a static variable on that function (or procedure), e.g.
{$J+}
procedure A; const C: integer = 0; begin Inc(C); Writeln(C); end;
{$J-}
You can use a const in a function and wrap it in {$J+} to allow modifying consts. And that's a static variable on that function (or procedure), e.g.
{$J+}
procedure A; const C: integer = 0; begin Inc(C); Writeln(C); end;
{$J-}