Hi,
In my Ruby code I intend to give a warning when a value is not given for a parameter. In that case I want the user to accept a default value being assigned to that parameter.
This is usually done by "gets.chomp" or "gets.strip". However, I get an error when I use either of these. Any solution in mind?
def x?
while true
print "Would you like to use the default value? [y/n]: "
case gets.strip
when 'Y', 'y','yes'
x = @xx
puts 'Default value has been assigned'
when /\A[nN]o?\Z/ #n or no
break
end
end
end
Comments
value = RBA::InputDialog.get_int("Trench_width", "Give a value for trench width",default )