Average rating:
set evalcmd [lcdui.command -label Evaluate -longlabel Evaluate]
set textfield [lcdui.textfield -text {[lcdui.alert -text "hi!"] setcurrent}]
set form [lcdui.form -title "Text Field Example" -commandaction \
[list runCode $textfield]]
$form append $textfield
$form setcurrent
$form addcommand $evalcmd
proc runCode {txtfld cmd frm} {
eval [$txtfld cget -text]
}