On 9/7/07, Helgitomas Gislason <nitrohelgso / hotmail.com> wrote:
> Hello. When it comes to big, complex and long programs, you don't always
> want to be needing to say at every single string:
>
> if answer == 'exit'
>   exit
> end

def get_input(prompt)
  puts prompt
  retval = gets.chomp
  if retval == 'exit'
    exit
  else
    return retval
  end
end

a = get_input "Enter your name"
# etc.

martin