while-loop not executable in RDE

D

draq

I have written a small script with a while-loop and tried to execute it
in RDE. But the console shows nothing but only "[EOF]" and it is dark
grey. I have to stop it manually.

The script is like this:

while true
print "Input: "
input = gets.chop

case input
when "exit" then break
when "calc" then calc
else puts "Input is invalid!"
end

end

In DOS it works well. Does anyone know the problem?
 
D

daz

draq said:
I have written a small script with a while-loop and tried to execute it
in RDE. But the console shows nothing but only "[EOF]" and it is dark
grey. I have to stop it manually.


In DOS it works well. Does anyone know the problem?

Put the following line at the top and then you'll see your prompt
(which is there, but stuck in a windows buffer):

STDOUT.sync=true


daz
 
D

draq

Thank you, daz! Do you know the link to the official bug-list?
Is there a possibility to execute this line automatically before every
execution?

draq
 
D

daz

draq said:
Thank you, daz! Do you know the link to the official bug-list?

http://sourceforge.net/forum/forum.php?forum_id=142794

It's not an RDE bug, it's a Windows 9x thing.

I'm told that on XP, a read from STDIN flushes STDOUT
first, so you don't get this annoyance.

Is there a possibility to execute this line automatically
before every execution?

Buffers speed things up substantially; you could be
redirecting STDOUT to a disk file. So no-one's
going to do that -- you just have to remember it
before a puts/gets sequence.

Try taking it out again and you'll see that you can
input data OK but responses will be delayed.

STDERR is *not* buffered, so you see error messages straight away.


daz
 

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
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top