cfad47cfa3/t3compiler/tads3/test/data/anonlist.t
| 4b825dc642cb6eb9a060e54bf8d69288fbee4904 | cfad47cfa334b206c65f22086bcc5d63e6f70944 | ||
|---|---|---|---|
1 | #include <tads.h> | ||
2 | |||
3 | myObj: object | ||
4 | lst = [ ({: "This is <<name>>. "}), ({: "I am <<name>>. "}) ] | ||
5 | lst2 = [ (self.name), (self.name) ] | ||
6 | lst3 = (showName) | ||
7 | name = 'myObj' | ||
8 | showName() | ||
9 | { | ||
10 | tadsSay(name); | ||
11 | } | ||
12 | showDisp(which) | ||
13 | { | ||
14 | (lst[which])(); | ||
15 | } | ||
16 | ; | ||
17 | |||
18 | main(args) | ||
19 | { | ||
20 | myObj.showDisp(1); "\n"; | ||
21 | myObj.showDisp(2); "\b"; | ||
22 | |||
23 | "<<myObj.lst2[1]>>\n<<myObj.lst2[2]>>\b"; | ||
24 | |||
25 | myObj.lst3; "\b"; | ||
26 | } |
Download diff