[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

linux starting

mailer mailer

4/27/2008 7:35:00 PM

[Note: parts of this message were removed to make it a legal post.]

I'm starting to program in linux more often now and I'm starting on linux
(Ubuntu). I'm using Kdevelop and I cannot get the program to run and take a
gets statement meaning I cannot get user input. any advice would be very
helpful

2 Answers

princeofnigeria

4/27/2008 7:45:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Please post your source code and I wil take a stab at why you cant get it to
run. I develop in kdevelop also.

On Sun, Apr 27, 2008 at 2:35 PM, mailer mailer <mailer76@gmail.com> wrote:

> I'm starting to program in linux more often now and I'm starting on linux
> (Ubuntu). I'm using Kdevelop and I cannot get the program to run and take
> a
> gets statement meaning I cannot get user input. any advice would be very
> helpful
>

Marc Heiler

4/27/2008 8:16:00 PM

0

> I'm using Kdevelop and I cannot get the program to run and
> take a gets statement meaning I cannot get user input.

You could try it simpler, just any editor that does not annoy you,
i.e. nano or bluefish. Save your .rb file, inside it something like:


puts 'Enter input now please:'
user_input = gets.chomp

case user_input
when 'q'
puts 'bye!'
exit
when 'hi'
puts 'Hi there, lets code more'
else
puts 'Input '+user_input+' was unknown to me.'
end


And if you saved it like named "foobar.rb", do
ruby foobar.rb

It should wait for your user input.
--
Posted via http://www.ruby-....