tb0282.pp 406 B

12345678910111213141516171819202122232425
  1. { Old file: tbs0334.pp }
  2. { }
  3. {$ifdef fpc}{$mode objfpc}{$endif}
  4. type
  5. tvarrec=record
  6. vpointer : pointer;
  7. end;
  8. var
  9. r : tvarrec;
  10. b : boolean;
  11. function Next: TVarRec;
  12. begin
  13. next:=r;
  14. end;
  15. begin
  16. r.vpointer:=@b;
  17. { The result of next is loaded and a value is assigned }
  18. with Next do
  19. boolean(VPointer^) := true;
  20. if not b then
  21. writeln('Error with assigning to function result');
  22. end.