| 1234567891011121314151617181920212223242526 |
- MODULE Showcase4;
- (* Step-11 tour: DEFINITION/IMPLEMENTATION library, IMPORT + FROM,
- qualified and unqualified use, lib init before program body. *)
- FROM S4L IMPORT Pair, Add;
- VAR p, q : Pair;
- VAR w : INTEGER;
- VAR total : INTEGER;
- VAR ExitCode : INTEGER;
- BEGIN
- total := 0;
- WriteString("show4");
- w := S4L.n;
- S4L.Bump(w);
- S4L.n := w;
- total := total + S4L.n;
- p.a := 1; p.b := 2;
- q := p;
- total := total + q.a + q.b;
- total := total + Add(S4L.base, 5);
- total := total + S4L.base;
- WriteInt(total);
- ExitCode := total
- END Showcase4.
|