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