Debian Codegraph @

terps/tads/tads3/test/data/objrep1.t

raw
1 /*
2 * object replacement test
3 */
4
5 #include "tads.h"
6 #include "t3.h"
7
8
9 /*
10 * define our base objects
11 */
12 obj1: object
13 p1 = "This is obj1.p1"
14 p2 = "This is obj1.p2"
15 p3 = "This is obj1.p3"
16 ;
17
18 obj2: object
19 p2 = "This is obj2.p2"
20 p1 = "This is obj2.p1"
21 ;
22
23 /*
24 * replace object obj1 within this translation unit
25 */
26 replace obj1: object
27 p1 = "This is replaced obj1.p1"
28 p2 = "This is replaced obj1.p2"
29 p4 = "This is replaced obj1.p4"
30 ;
31
32 /*
33 * display information on an object
34 */
35 function showObj(obj, nm)
36 {
37 "----\nShowing information for <<nm>>:\n";
38
39 "\tp1 -> << obj.p1 >>\n";
40 "\tp2 -> << obj.p2 >>\n";
41 "\tp3 -> << obj.p3 >>\n";
42 "\tp4 -> << obj.p4 >>\n";
43
44 "\n";
45 }
46
47 function _say_embed(str)
48 {
49 tadsSay(str);
50 }
51
52 function _main(args)
53 {
54 t3SetSay(_say_embed);
55
56 showObj(obj1, 'obj1');
57 showObj(obj2, 'obj2');
58 }
59