aboutsummaryrefslogtreecommitdiff
path: root/tests/i/class-new-methods/program.cps
blob: 880f538f74ac69a908a70eb219fb99d8a8b2f9af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

CLASS Box
    Value : STRING
    PROCEDURE NEW(Text : STRING)
        Value <- Text
    ENDPROCEDURE
    PROCEDURE Reset()
        this.NEW("again")
    ENDPROCEDURE
ENDCLASS
DECLARE Obj : Box("initial")
Obj.NEW("x")
OUTPUT Obj.Value
CALL Obj.new("call")
OUTPUT Obj.Value
Obj.Reset()
OUTPUT Obj.Value