Ok so i am trying to get my if statement to work but my console keeps
closing out and i don't know how to keep it open other than using gets
which doesn't seem to work when there's an error, the c++ equivalent of
keeping the console open is cin.get() which waits for user input, is
gets the ruby equivalent or is there another way to keep it open no
matter what? but anyways here is my code:

print "Please enter your age"
age = gets

if age < 18
print "you are younger than 18"
end
if age > 18
print "you are older than 18"
end

gets


when i do age = 14 it seems to work ok but it wont work with = gets

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