From: Logan Capaldo Date: 2006-08-16T06:28:06+09:00 Subject: Re: goto function? On Aug 15, 2006, at 5:05 PM, fabsy wrote: > > >> begin >> ... >> end while your_condition_here >> >> begin >> ... >> end until your_condition_here >> >> If you need an endless loop >> >> loop do >> ... >> end >> >> See also >> http://ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#S6 >> >> Note that your script opens the file over and over again and never >> closes it. This can cause problems - especially since you do it with >> different modes. >> >> Kind regards >> >> robert > > I don't really understand.. > > I want the script to start over again.. for example.. > When the user made an input and pressed return I want the script to > "restart" or jump to the beginning.. I wouldn't recommend making this a habit but: % cat cc.rb x = 0 bar = callcc {|cc| cc} puts "Hello" x += 1 bar.call(bar) unless x == 3 puts "x is #{x}" % ruby cc.rb Hello Hello Hello x is 3