[Gambas-user] READ-Event on #File.in ???

Benoit Minisini gambas at ...1...
Wed Jul 9 22:39:11 CEST 2008


On mercredi 09 juillet 2008, gambas at ...1938... wrote:
> Hi everybody!!!
>
> Is it possible to get a READ-Event on #File.in?
>
> Background is: The external process, which is spawning my program, is a
> little bit flaky regarding its timings. It pushes it's data randomly via
> STDOUT into my prog.
> When I use the "WHILE NOT Eof(File.In)"-Example taken from the online help,
> I always get disconnected from the external process, after the WEND...but I
> have to send some data back, too! ;-)
> To bring some light into the dark: At first, i have to read the whole
> message block (terminated by an empty line), after that, I'm able to send
> my onw data back to the process.
>
> If I didn't misunderstand the concepts of READ-Event, it sit's on the
> stream and every time data arrives, it reads the incoming data
> automagically :-)
>
> TIA
> Stevie
>

If you declare a STATIC PUBLIC SUB named Application_Read() in your startup 
class, then you will get what you want: the File.In stream is watched, and 
the Application_Read() function is called as soon as there is something to 
read on the standard input.

Regards,

-- 
Benoit Minisini




More information about the User mailing list