| 1 |
#include "tads.h" |
| 2 |
|
| 3 |
/* define the T3 system interface */ |
| 4 |
intrinsic 't3vm/010000' |
| 5 |
{ |
| 6 |
t3RunGC(); |
| 7 |
t3SetSay(funcptr); |
| 8 |
t3GetVMVsn(); |
| 9 |
t3GetVMID(); |
| 10 |
t3GetVMBanner(); |
| 11 |
t3GetVMPreinitMode(); |
| 12 |
} |
| 13 |
|
| 14 |
function _say_embed(str) |
| 15 |
{ |
| 16 |
tadsSay(str); |
| 17 |
} |
| 18 |
|
| 19 |
function _main(args) |
| 20 |
{ |
| 21 |
local lst = ['one', 'two', 'three', 'four', 'five', |
| 22 |
'six', 'seven', 'eight', 'nine', 'ten']; |
| 23 |
local x; |
| 24 |
|
| 25 |
t3SetSay(_say_embed); |
| 26 |
|
| 27 |
"This is a test of double-quoted strings.\b"; |
| 28 |
|
| 29 |
for (local i = 1 ; i <= 10 ; ++i) |
| 30 |
"This is embedded string <<lst[i]>>\n"; |
| 31 |
|
| 32 |
x = 5; |
| 33 |
(x > 3 ? "x is greater than 3 (correct)" : "huh? x is less than 3??"); |
| 34 |
"\n"; |
| 35 |
(x < 3 ? "x is less than 3 (wrong)" : "x is still greater than 3!"); |
| 36 |
"\n"; |
| 37 |
|
| 38 |
"\bDone!!!\n"; |
| 39 |
} |