Variables should be available to all functions in its scope. This includes functions that are further down in the hierarchy. Right now variables are only available to the block in which they are defined.
This should compile:
program HelloWorld;
procedure test();
var
i: integer;
procedure test2();
begin
i:= 2;
end;
begin
test2();
writeln(i);
end;
begin
test();
end.
Variables should be available to all functions in its scope. This includes functions that are further down in the hierarchy. Right now variables are only available to the block in which they are defined.
This should compile: