Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorhpishvai
    • CommentTimeJan 24th 2018
     
    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
    • CommentAuthorhpishvai
    • CommentTimeJan 24th 2018
     
    Never mind, I think I found a solution for this one:

    value = RBA::InputDialog.get_int("Trench_width", "Give a value for trench width",default )