The
implementation section, like the
interface section, is global. You can only create subsections with global
type/
const/
var in it, as well as list procedures/methods.
That is, instead of this:
unit Unit1;
interface
implementation
// anycode - ERROR
end.
you just wanted to write this:
unit Unit1;
interface
implementation
procedure test;
begin
// any code - OK
end;
end.
to call
test procedure from somewhere. But if you want to write code in the unit itself, there is also an
initialization section:
unit Unit1;
interface
implementation
initialization
// any code - OK
end.
In general, do not confuse it with a "
program" that does not have these sections. But it also specifies the code after the "global"
begin (similar to initialization):
program Project1;
procedure test;
begin
// any code - OK
end;
begin
// any code - OK
end.
But the author of the topic did not specify the full code of his program, so we can only guess that he has the same problem.