[net.micro.amiga] Using standard input/output to new window

rokicki@navajo.STANFORD.EDU (Tomas Rokicki) (07/31/86)

Someone posted a question about using stdio functions to a new window.
Well, this is a trick I use sometimes.

------cut here------
mywindow() {
   FILE *fopen() ;
   FILE *input, *output ;
   FILE temp ;

   output = fopen("con:170/50/300/100/Temporary Window", "w+") ;
   if (output == NULL) {
      error("Could not open temporary window.") ;
      return ;
   }
   input = &temp ;
   *input = *output ;
/*
 *   Do standard input/output here.
 */
   fclose(input) ;
   fclose(output) ;
}
------cut here------

This works with Manx; it may or may not work with Lattice.  I use code
much like this at the beginning of all of my programs to open a console
window in case the code was called from the WorkBench rather than from
the CLI.  It's truly a hack, though.