From: Jason Roelofs Date: 2006-11-07T02:54:17+09:00 Subject: Re: Ruby script auto-closes at completion ------=_Part_44525_2380584.1162835650963 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Don't run it from Explorer. Start -> Run -> 'cmd', then navigate to the folder you want and type 'ruby your_script.rb'. Jason On 11/6/06, John Tar wrote: > > Hi > > I am a newbie. I am trying to run some small ruby programs to learn a > bit about ruby. > > everytime i run the following program in windows it auto closes when it > is done, so there is no time to see the final result > > is there any way to allow it to just freeze and not autoclose...the way > i was doing it,is by putting a gets at the end....but i am sure there is > a better way > > thanks > > john > > code: > > > puts 'what is you first name?' > name = gets.chomp > a=name.length.to_i > puts a > > puts 'what is you midlle name?' > mname=gets.chomp > b=mname.length.to_i > puts b > > puts 'what is you last midlle name?' > lname=gets.chomp > c=lname.length.to_i > puts c > > d=a+b+c > > puts 'there are ' + d.to_s + ' characters in your name:' + > mname.swapcase > > > > > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_44525_2380584.1162835650963--