t_with.mod 398 B

1234567891011121314151617181920212223
  1. MODULE TWith;
  2. // WITH incl. multi-designator shadowing and nesting. Exit 114.
  3. TYPE Point = RECORD x, y : INTEGER END;
  4. VAR ExitCode : INTEGER;
  5. VAR p, q : Point;
  6. BEGIN
  7. p.x := 5; p.y := 6;
  8. WITH p DO
  9. x := x + 1;
  10. y := x + y
  11. END;
  12. WITH p, q DO
  13. x := 1;
  14. y := 2
  15. END;
  16. WITH p DO
  17. WITH q DO
  18. x := 100
  19. END;
  20. y := x
  21. END;
  22. ExitCode := p.x + p.y + q.x + q.y
  23. END TWith.