terps/tads/tads3/test/data/tilford-stringof-list.t
raw| 1 | #include <tads.h> |
| 2 | |
| 3 | main(args) |
| 4 | { |
| 5 | "length (global.l1) == <<global.l1.length()>>\n"; |
| 6 | for (local i = 1 ; i < global.l1.length() ; ++i) |
| 7 | "[<<i>>] = \"<<global.l1[i]>>\"\n"; |
| 8 | } |
| 9 | |
| 10 | global: PreinitObject |
| 11 | execute() |
| 12 | { |
| 13 | "In preinit\n"; |
| 14 | for (local limit = 0 ; limit < 1000 ; ++limit) |
| 15 | l1 += stringOf(limit); |
| 16 | } |
| 17 | l1 = [] |
| 18 | ; |
| 19 | |
| 20 | stringOf(i) |
| 21 | { |
| 22 | local rv = ''; |
| 23 | while (--i > 0) |
| 24 | rv += toString(i); |
| 25 | return rv; |
| 26 | } |