| 1 |
/* |
| 2 |
* test of 'replace function' |
| 3 |
*/ |
| 4 |
|
| 5 |
#include "tads.h" |
| 6 |
#include "t3.h" |
| 7 |
|
| 8 |
function _say_embed(str) |
| 9 |
{ |
| 10 |
tadsSay(str); |
| 11 |
} |
| 12 |
|
| 13 |
function _main(args) |
| 14 |
{ |
| 15 |
t3SetSay(_say_embed); |
| 16 |
|
| 17 |
"Calling f1(123, 456)...\n"; |
| 18 |
f1(123, 456); |
| 19 |
|
| 20 |
"Calling f2(789, 987, 323)...\n"; |
| 21 |
f2(789, 987, 323); |
| 22 |
} |
| 23 |
|
| 24 |
function f1(a, b) |
| 25 |
{ |
| 26 |
"This is the original f1: a = <<a>>, b = <<b>>.\n"; |
| 27 |
f2(a, b, 'f1.c'); |
| 28 |
} |
| 29 |
|
| 30 |
function f2(a, b, c) |
| 31 |
{ |
| 32 |
"This is the original f2: a = <<a>>, b = <<b>>, c = <<c>>\n"; |
| 33 |
} |
| 34 |
|
| 35 |
replace function f1(a, b) |
| 36 |
{ |
| 37 |
"Replaced f1 - a = <<a>>, b = <<b>>.\n"; |
| 38 |
} |