From: Matthew Moss Date: 2007-03-31T04:07:28+09:00 Subject: Re: Newbie needs a pointer Offhand, I'd guess that the return value from gets also includes the newline char(s). Try: name = gets.chomp On 3/30/07, dwyer@o2.ie wrote: > Hi all, just started looking at Ruby in earnest today and my logic has failed me already. Can > someone provide some subtle hints are to where the following code needs attension. Its currently > stuck in a continuous loop, and 'q' doesnt exit the loop. > > #a continous loop until 'q' is press > puts "Please enter your name?" > name=gets > while (name!='q') > puts "welcome, #{name}Enter your name again:" > name=gets > > end > > > -- > --------------------------------- --- -- - > Posted with NewsLeecher v3.9 Beta 1 > Web @ http://www.newsleecher.com/?usenet > ------------------- ----- ---- -- - > > >