RE: Redirection of output

new topic     » topic index » view thread      » older message » newer message

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C220C2.06897090
 charset=iso-8859-1

I'm not sure if this is what you are after , but I tend to do this sort of
thing...

  if platform() != WIN32 then
    puts(2, "Press any key...")
    junk = wait_key()	
  end if

> -----Original Message-----
> From: Juergen Luethje [mailto:jluethje at gmx.de]
> Sent: Monday, 1 July 2002 15:39
> To: EUforum
> Subject: Redirection of output
> 
> 
> 
> Hello all,
> 
> how can a windows program detect, whether it's output has been
> redirected to a file?
> 
> Normally, when I want to see the output of puts(1, ...), I must
> add wait_key() or something similar to the code. Then I have the
> following code, for instance:
> 
> ----------------------------------------------------------
> include get.e
> integer junk
> 
> puts(1, "Hello World!\n\n")
> puts(2, "Press any key...")
> junk = wait_key()
> ----------------------------------------------------------
> 
> When the output is redirected, the statements
>    puts(2, "Press any key...")
>    junk = wait_key()
> are not useful.
> 
> It would be very helpful, to have a function for this, so that
> the code could be written as:
> 
> ----------------------------------------------------------
> include get.e
> integer junk
> 
> puts(1, "Hello World!\n\n")
> if not output_redirected() then
>    puts(2, "Press any key...")
>    junk = wait_key()
> end if
> ----------------------------------------------------------
> 
> Can anyone help?
> 
> Thanks in advance,
>    Juergen
> 
> 
> 
> 

==================================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en 
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht 
onterecht ontvangt wordt u verzocht de inhoud niet te gebruiken en 
de afzender direct te informeren door het bericht te retourneren. 
==================================================================
The information contained in this message may be confidential 
and is intended to be exclusively for the addressee. Should you 
receive this message unintentionally, please do not use the contents 
herein and notify the sender immediately by return e-mail.


==================================================================

------_=_NextPart_000_01C220C2.06897090
Content-Type: application/ms-tnef

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu