very simple question

T

Tom Cloyd

Bewilderer, tired beginner, here.

Executing this, in Arachno Ruby IDE -

print 'process ' + filenm + ' (1) or all files of type ' + filetyp + ': '
pf =3D gets

I get -
1. nothing for my print statement - control just passes right past it.
2. a "Exception: Bad file descriptor" out for "pf =3D gets"

I don't understand why either is happening. Can someone clear this up for=
=20
me?

-- Tom C.
 
J

Joe Van Dyk

Bewilderer, tired beginner, here.

Executing this, in Arachno Ruby IDE -

print 'process ' + filenm + ' (1) or all files of type ' + filetyp + ': '
pf =3D gets

I get -
1. nothing for my print statement - control just passes right past it.
2. a "Exception: Bad file descriptor" out for "pf =3D gets"

I don't understand why either is happening. Can someone clear this up for
me?

I don't understand what you're trying to do.
 
T

Tom Cloyd

This is just a snippet from a larger program. Here, I'm trying to print t=
o =20
STOUT a prompt, then get a response, so I can act on it.

t.
 
T

Tom Cloyd

I just ran this (example from a book) --

print "Enter your name: "
name =3D gets

And had exactly the same problem. However, running it outside of =20
ArachnoRuby, simply as a Ruby file (I'm on WinXP), it runs fine. So, I =20
have a problem with how my IDE is functioning - I'm new to that as well. =
=20
I'll look at that...

t.

I don't understand what you're trying to do.



--=20

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Tom Cloyd, MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< TC.BestMindHealth.com / BestMindHealth.com >>
<< (e-mail address removed) >>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 
R

Robert Klemme

Tom Cloyd said:
I just ran this (example from a book) --

print "Enter your name: "
name = gets

And had exactly the same problem. However, running it outside of
ArachnoRuby, simply as a Ruby file (I'm on WinXP), it runs fine. So, I
have a problem with how my IDE is functioning - I'm new to that as
well. I'll look at that...

This is probably an issue of buffered IO and / or changed outputs. I'd try

$stdout.sync = true
$stdout.print "Enter your name: "
name = $stdin.gets

HTH

robert
 
J

J. Ryan Sobol

--Apple-Mail-30-879976446
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

I don't run Win XP, but my first thought is verify the path to your
ruby interpreter in your IDE.
____ _ _ ____ ____
/ ___) | | |/ _ | _ \
| | | |_| ( ( | | | | |
|_| \__ |\_||_|_| |_|
(____/


I just ran this (example from a book) --

print "Enter your name: "
name = gets

And had exactly the same problem. However, running it outside of
ArachnoRuby, simply as a Ruby file (I'm on WinXP), it runs fine.
So, I have a problem with how my IDE is functioning - I'm new to
that as well. I'll look at that...

t.





--

================================================
Tom Cloyd, MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< TC.BestMindHealth.com / BestMindHealth.com >>
<< (e-mail address removed) >>
================================================


--Apple-Mail-30-879976446--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,654
Latest member
LannySinge

Latest Threads

Top