t99_valreal.pas 420 B

123456789101112131415161718192021222324252627282930
  1. program t99_valreal;
  2. { t99 -- value REAL parameters. `id(X : real)' receives a six-byte copy on
  3. the stack; the argument is a VAR REAL parameter inside `put'. }
  4. type
  5. R = record
  6. V : real;
  7. end;
  8. var
  9. A : R;
  10. S : string[10];
  11. function id (X : real) : real;
  12. begin
  13. id := X
  14. end;
  15. procedure put (var Z : real);
  16. begin
  17. Z := id (Z)
  18. end;
  19. begin
  20. A.V := 3;
  21. put (A.V);
  22. Str (A.V : 0 : 0, S);
  23. writeln (S)
  24. end.