tw17379.pp 507 B

12345678910111213141516171819202122232425262728293031323334
  1. {$mode macpas}
  2. {$warnings off}
  3. program recursivefunctionparam;
  4. function first( function test( theint: integer): boolean): integer;
  5. begin
  6. test(2);
  7. end;
  8. function find: integer;
  9. var
  10. l: longint;
  11. function test( theint: integer): boolean;
  12. begin
  13. if (theint = 1) then
  14. first( test)
  15. else
  16. begin
  17. writeln('nested procvar call, l = ', l);
  18. if l<>1234567890 then
  19. halt(1);
  20. end;
  21. find:=0;
  22. end;
  23. begin
  24. l:=1234567890;
  25. test(1)
  26. end;
  27. begin
  28. find;
  29. end.