Anonymous user
User input/Text: Difference between revisions
m
→{{header|Tcl}}: small improvements/formatting
(→{{header|AutoHotkey}}: windows console example) |
m (→{{header|Tcl}}: small improvements/formatting) |
||
Line 494:
Like LISP, there is no concept of a "number" in TCL - the only real variable type is a string (whether a string might represent a number is a matter of interpretation of the string in a mathematical expression at some later time). Thus the input is the same for both tasks:
<lang tcl>
possibly followed by something like
<lang tcl>
If the requirement is to prompt until the user enters the integer 75000, then:
<lang tcl>set input 0
while {$input != 75000} {
Line 509 ⟶ 508:
set input [gets stdin]
}</lang>
Of course, it's nicer to wrap the primitives in a procedure:
<lang tcl>proc question {var message} {
upvar 1 $var v
Line 519:
question task "What is your quest"
question doom "What is the air-speed velocity of an unladen swallow"</lang>
=={{header|Toka}}==
|