[::learn::header "Tcl in your Page"]
[Doc_Dynamic]

This page shows what you can do with a little bit of Tcl code in a page.

Right below the <hr> horizontal line we'll display the
result of the Example1 procedure:
<p>

<p>
[if {[catch {interp eval learn Example1} result]} {
  set _ "Error
\n$result\n
"
} else {
  set _ $result
}]
<p>

<p>
The body of the Example1 procedure is shown here.

[if {[info proc Example1] == ""} {
  set _ "# Example1 is not a procedure"
} else {
  set _ [info body Example1]
}]

<p>

Hint if there is no procedure, try
return "<b>\[clock format \[clock seconds\]\]</b>"

Understand that this code runs with all the powers of the
web server application.  If you want to halt the server, try this.

exit

Ha! tried it, huh?  This page runs Example1 in a Safe-Tcl interpreter,
although the TML template system normally runs the templates in
the main interpreter of your application.
[mypage::footer]
