yeah i like your way alot better than num = Integer(STDIN.gets) rescue
nil



Guest wrote:
> corey konrad wrote:
>>>because it needs to be a string when you print it.
>> 
>> oh ok that makes sense, isnt there a getn method for getting number or 
>> other data types or do i always have to use gets?
> 
> There could be:
> 
> irb(main):001:0> def getn
> irb(main):002:1> foo = gets
> irb(main):003:1> foo.to_i
> irb(main):004:1> end
> => nil
> 

-- 
Posted via http://www.ruby-forum.com/.