| 1234567891011121314151617181920212223242526272829303132 |
- Listing:
- 1 MODULE Showcase4;
- 2
- 3 (* Step-11 tour: DEFINITION/IMPLEMENTATION library, IMPORT + FROM,
- 4 qualified and unqualified use, lib init before program body. *)
- 5
- 6 FROM S4L IMPORT Pair, Add;
- 7 VAR p, q : Pair;
- 8 VAR w : INTEGER;
- 9 VAR total : INTEGER;
- 10 VAR ExitCode : INTEGER;
- 11
- 12 BEGIN
- 13 total := 0;
- 14 WriteString("show4");
- 15 w := S4L.n;
- 16 S4L.Bump(w);
- 17 S4L.n := w;
- 18 total := total + S4L.n;
- 19 p.a := 1; p.b := 2;
- 20 q := p;
- 21 total := total + q.a + q.b;
- 22 total := total + Add(S4L.base, 5);
- 23 total := total + S4L.base;
- 24 WriteInt(total);
- 25 ExitCode := total
- 26 END Showcase4.
- 0 errors
|