C
caof2005
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.
Any help would be very appreciated.
Regards
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.
Any help would be very appreciated.
Regards