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