Anonymous user
User Input: Difference between revisions
m
Tcl: move non-gui answer out of gui section
(→{{header|Ruby}}: ++ rexx) |
m (Tcl: move non-gui answer out of gui section) |
||
Line 514:
set input [gets stdin]
}</lang>
or
<lang tcl>proc question {var message} {▼
upvar 1 $var v▼
puts -nonewline "$message: "▼
flush stdout▼
gets stdin $v▼
}▼
question name "What is your name"▼
question task "What is your quest"▼
question doom "What is the air-speed velocity of an unladen swallow"</lang>▼
=={{header|Toka}}==
Line 609 ⟶ 620:
puts $input</lang>
The <tt>-validate</tt> option can be used to test the contents/edits of the widget at any time against any parameters (including testing <tt>string is integer</tt> when the user hits <Return> or such)
▲<lang tcl>proc question {var message} {
▲ upvar 1 $var v
▲ puts -nonewline "$message: "
▲ flush stdout
▲ gets stdin $v
▲}
▲question name "What is your name"
▲question task "What is your quest"
▲question doom "What is the air-speed velocity of an unladen swallow"</lang>
=={{header|VBScript}}==
|