home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / amiga / programm / 19215 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.6 KB

  1. Path: sparky!uunet!math.fu-berlin.de!ira.uka.de!smurf.sub.org!easix!teralon!darkness.gun.de!rseichter
  2. From: rseichter@darkness.gun.de (Ralph Seichter)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: using the __tinymain function...
  5. Message-ID: <zpcaaNqDBh@darkness.gun.de>
  6. Organization: DARKNESS Public Mailbox, Kerpen, Germany
  7. Date: Mon, 25 Jan 1993 17:52:00 +0100
  8. Lines: 35
  9.  
  10. ummuir05@ccu.umanitoba.ca (John Derek Muir) wrote
  11.  
  12. > I'd like to use the __tinymain function with my program, AND use the
  13. > standard io function called printf.
  14. > Now, do I just have to open a file called stdio??  or what?
  15.  
  16. I  suppose you want your program to detach from the calling CLI process (at
  17. least that's what *I* use ___tinymain for).  If that's true, you don't have
  18. standard  I/O  channels  and you'll have to supply your own ones.  printf()
  19. won't do, but how about fprintf() instead?  Try this:
  20.  
  21. VOID myPrintf (STRPTR msg)
  22. {
  23.    BPTR output;
  24.  
  25.    if (output = Open ("con:0/0/400/200/My own IO/close/wait"))
  26.    {
  27.       /* We got the window */
  28.       fprintf (output, "%s\n(please close window)", msg);
  29.       Close (output);
  30.    } else
  31.       /* YO! No output window available, */
  32.       /* use some EasyRequest instead. */
  33.       myEasyRequest (msg);
  34. }
  35.  
  36. This  (very  dumb)  function  will open its own CON window for output.  The
  37. user  has  to close this window manually, but myPrintf() may be called even
  38. if your program is run from Workbench.  Hope it helps.  ;)
  39.  
  40.     MfG,    Ralph
  41. --
  42. Helen paused. With an audible "WHUMP", Muffy's familiar yipping had ended,
  43. and only the sound of Ed's football game now emanated from the living room.
  44. [GL] rseichter@darkness.gun.de # Tel (+49) 2233 70293 # Zodiac's Point 3.0
  45.