From: Phillip Gawlowski Date: 2007-04-11T16:24:32+09:00 Subject: Re: Newbe - strange behavior of print caof2005 wrote: > Hello folks, this is the scenario: > I tried to run the following code in EasyEclipse for Ruby IDE and > SciTE on WinXP > Both has the same behavior. > > def main > print "Enter the number of employees: " > numEmp = gets > puts "The number of employees is:= " + numEmp.to_s > end > > main > > ==================== > > The output is nothing ( it appears that the program hangs-on for a > while ), then if go to the console and I push the ENTER key it appears > the "Enter the number of employees: " and suddenly the program > terminates. > > What I'm doing wrong?, I tried to follow the instructions from several > books ( David Black's "Ruby for Rails" and Dave Thomas "Programming > Ruby" ) and both indicates that the kind of code that I wrote should > work. > Have you, per chance, tried to invoke your script from the command line? I know that SciTE needs to be patched in one way or another to allow for input. I can't judge Eclipse in that regard, as I don't use it. -- Phillip "CynicalRyan" Gawlowski http://cynicalryan.110mb.com/ Rule of Open-Source Programming #9: Give me refactoring or give me death!