[Gambas-user] commandline output redirect?
Ron
ron at ...1740...
Wed May 21 14:23:30 CEST 2008
Ok, I now see it documents the KEYWORDS to open stream instead of
COMMANDS sorry for the confusion!
> Benoit Minisini schreef:
>
>> On mercredi 21 mai 2008, Ron wrote:
>>
>>
>>> Hi,
>>>
>>> If you create a gambas command line application with a loop in it,
>>> standard output cannot be redirected to a file.
>>>
>>> This works:
>>> -----------------------------------
>>> PUBLIC SUB Main()
>>> PRINT "test output"
>>> END
>>>
>>> ./test.gambas >test.log
>>> cat test.log
>>> test output
>>>
>>> This doesn't work:
>>> ------------------------------------
>>> PUBLIC SUB Main()
>>> PRINT "test output"
>>> WHILE (1)
>>> 'do something
>>> WAIT 1
>>> WEND
>>> END
>>>
>>> ./test.gambas >test.log
>>> CTRL-C
>>> test.log is empty
>>> ------------------------------------
>>> Unbuffered printing to default output (with Write "test output") gives
>>> the same result.
>>>
>>>
>>> Gambas 2.6.0
>>>
>>> Regards,
>>> Ron.
>>>
>>>
>>>
>> Where did you see that WRITE is unbuffered and PRINT is buffered?
>>
>>
> Benoit ,
>
> here: http://gambasdoc.org/help/lang/open
>
> next to the ! mark
>
>
>> Standard output and standard error output are both buffered, whatever stream
>> instruction or function you use.
>>
>> If you want to flush a buffered output stream, just use the FLUSH instruction.
>> I suggest you read the documentation on Gambas File I/O functions.
>>
>>
>>
> I'm flushing now inside my loop every now and then, that seems to work.
>
> Is it possible to catch keyboard input while running command line app?
> Sorry for the questions, but my app is using alot of different command
> and routines.
>
> Thanks.
> Ron.
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list