[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

How to terminate STDIN input in Windows?

Robo

10/3/2004 2:59:00 AM

I've got a piece of code like this to get multi line input from STDIN:

while (s = gets()) != nil
#whip s till it bleeds
end

When I run it, I'm able to get each line of input I type in, but I can't
figure out how to terminate the input e.g. "OK, I've given you all the
inputs, exit the loop"

In Linux, I think it was done by pressing ^D at the end, but that
doesn't do anything in Windows. Any ideas?

Robo
1 Answer

Robo

10/3/2004 3:12:00 AM

0

Robo wrote:
> I've got a piece of code like this to get multi line input from STDIN:
>
> while (s = gets()) != nil
> #whip s till it bleeds
> end
>
> When I run it, I'm able to get each line of input I type in, but I can't
> figure out how to terminate the input e.g. "OK, I've given you all the
> inputs, exit the loop"
>
> In Linux, I think it was done by pressing ^D at the end, but that
> doesn't do anything in Windows. Any ideas?
>
> Robo

Just found out by trying out random combinations, think I got it to work
by pressing ^Z, then [Enter] and the end.

Robo