while true
x = STDIN.getc
break if x == 'q'
h.call
end
$ ./getchar.rb
Welcome
a
again again!
./getchar.rb:12:in `<main>': undefined method `call' for nil:NilClass (NoMethodError)
$ ./getchar.rb
Welcome
b
on no!
./getchar.rb:12:in `<main>': undefined method `call' for nil:NilClass (NoMethodError)
Any help is much appreciated
Regards,
Iain
--
Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
For all your IT requirements visit: http://www.transtec.co.uk