Page 1 of 1

Correct Input

Posted: Thu Jun 04, 2009 12:37 pm
by scottmaccal
Hi all,

I'm trying to verify correct input. I want to make sure that the user either inputs yes or no before the program continues. How would this best be accomplished? So far I this code fragment:

Code: Select all

(print "yes or no") 

(set 'answer (read-line))

# WAS THE ANSWER YES OR NO?

(if (= answer "yes")
  (print "yes "))

(if (= answer "no")
  (print "no"))

Never mind

Posted: Thu Jun 04, 2009 1:40 pm
by scottmaccal
Hi all,

Never mind. Solution found. I must have taken stupid pills this morning.