mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-01 11:00:42 +01:00
44 lines
478 B
ObjectPascal
44 lines
478 B
ObjectPascal
program tmaclocalprocparam;
|
|
{$MODE MACPAS}
|
|
|
|
var
|
|
failed: Boolean;
|
|
|
|
|
|
procedure Outside (procedure P);
|
|
begin
|
|
P;
|
|
end;
|
|
|
|
procedure Global;
|
|
|
|
var
|
|
nonlocalvar: integer;
|
|
|
|
procedure Local;
|
|
begin
|
|
nonlocalvar := 42;
|
|
end;
|
|
|
|
begin
|
|
nonlocalvar := 24;
|
|
Outside(Local);
|
|
failed := (nonlocalvar <> 42);
|
|
end;
|
|
|
|
|
|
|
|
begin
|
|
Global;
|
|
|
|
if failed then
|
|
writeln('Failed')
|
|
else
|
|
writeln('Succeded');
|
|
|
|
{$IFC UNDEFINED THINK_Pascal}
|
|
if failed then
|
|
Halt(1);
|
|
{$ENDC}
|
|
end.
|