Reputation: 101
I have a situation:
procedure Compile();
begin
//stuff
CompileBatch();
end;
procedure CompileBatch();
begin
//stuff
end;
But that obviously doesn't work, because identifier "CompileBatch" is not yet found in Compile. Are there any workarounds or do I have to rewrite all of the CompileBatch code in Compile? I'm using Free Pascal.
Upvotes: 1
Views: 83
Reputation: 30715
You can do this by declaring your CompileBatch forward
, like this:
procedure CompileBatch(); forward;
procedure Compile();
begin
//stuff
CompileBatch();
end;
procedure CompileBatch();
begin
//stuff
end;
Upvotes: 5