From: Damon C. <da...@yo...> - 2003-11-22 07:11:37
|
> So I did a little if statement > > if { [string match {[0-9]} $answer1 } { > puts "Yes, it a number!" > } else { > puts "Nope, it not a number!" > } > > So, what I guess I'm looking for is a way to ask for the input again > until it's a number. What you're probably looking for is something like: puts -nonewline "Enter volume: " while { ![string is integer -strict [set answer [gets stdin]]] } { puts -nonewline "Enter volume: " } This will loop and output the prompt "Enter Volume: " until the user types an integer. You could make it a little better, but that's the short of it. 0-] Damon |