Fossil SCM
| d8ed5a0… | drh | 1 | <th1> |
| d8ed5a0… | drh | 2 | # |
| d8ed5a0… | drh | 3 | # This is a "TH1 fragment" used to test the Tcl integration features of TH1. |
| d8ed5a0… | drh | 4 | # The corresponding test file executes this file using the test-th-render |
| d8ed5a0… | drh | 5 | # Fossil command. |
| d8ed5a0… | drh | 6 | # |
| d8ed5a0… | drh | 7 | proc doOut {msg} {puts $msg; puts \n} |
| a87eaae… | mistachkin | 8 | doOut "tclReady(before) = [tclReady]" |
| a87eaae… | mistachkin | 9 | set channel stdout; tclInvoke set channel $channel |
| a87eaae… | mistachkin | 10 | doOut "tclReady(after) = [tclReady]" |
| d8ed5a0… | drh | 11 | doOut [tclEval clock seconds] |
| d8ed5a0… | drh | 12 | doOut [tclEval {set x [clock seconds]}] |
| d8ed5a0… | drh | 13 | tclEval {puts $channel "[clock seconds]"} |
| d8ed5a0… | drh | 14 | tclInvoke puts $channel "via Tcl invoke" |
| d8ed5a0… | drh | 15 | doOut [tclExpr 2+2] |
| d8ed5a0… | drh | 16 | doOut [tclExpr 2 + 2] |
| d8ed5a0… | drh | 17 | doOut [tclInvoke set x "two words"] |
| d8ed5a0… | drh | 18 | doOut [tclInvoke eval set y one_word] |
| d8ed5a0… | drh | 19 | doOut [tclInvoke eval {set z "three words now"}] |
| d8ed5a0… | drh | 20 | doOut [set x [tclEval {set x [clock seconds]}]] |
| d8ed5a0… | drh | 21 | doOut [tclInvoke th1Eval {set y "two words"}] |
| d8ed5a0… | drh | 22 | doOut [set z [tclInvoke th1Expr {2+2}]] |
| d8ed5a0… | drh | 23 | doOut $x |
| d8ed5a0… | drh | 24 | doOut $y |
| d8ed5a0… | drh | 25 | doOut $z |
| d8ed5a0… | drh | 26 | doOut [tclEval set x] |
| d8ed5a0… | drh | 27 | doOut [tclEval set y] |
| d8ed5a0… | drh | 28 | doOut [tclEval set z] |
| d8ed5a0… | drh | 29 | </th1> |