Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!pdn!boake2!jc3b21!fgd3 From: fgd3@jc3b21.UUCP (Fabbian G. Dufoe) Newsgroups: comp.sys.amiga.tech Subject: Re: Open a console window from Lattice Message-ID: <812@jc3b21.UUCP> Date: 11 Dec 89 19:44:34 GMT References: <129043@sun.Eng.Sun.COM> Organization: St. Petersburg Jr. College, FL Lines: 37 Perhaps I'm missing something. If you want to open an Intuition window and then use the console.device to handle text output to that window the process is pretty straightforward. You'll need a message port, so call CreatePort(). It's documented in Autodocs1.3:LinkerLibs/amiga.lib.doc. Next you'll need a console message structure. Call CreateStdIO(). Maybe you should call CreateExtIO(). I read some discussion about that recently. You'll find a description of CreateExtIO() in Autodocs1.3:LinkerLibs/amiga.lib.doc. You won't find any documentation for CreateStdIO(). I shouldn't say that. You might find some. I didn't, though, and I looked pretty hard. But CreateStdIO() is the one used in the RKM: Libraries and Devices. It's what I used, and it worked. Once you've set up your message port and message structure you're nearly done. Just call load ConsoleMsg->io_Data with your window pointer and call OpenDevice("console.device", 0, ConsoleMsg, 0). ConsoleMsg is the pointer to the message structure returned by CreateStdIO. To write to the console you load your message structure as follows: ConsoleMsg->io_Command = CMD_WRITE; ConsoleMsg->io_Length = (ULONG)-1; ConsoleMst->io_Data = (APTR)String; and call DoIO(ConsoleMsg). CMD_WRITE is defined in exec/io.h. You use ANSI escape sequences to position the cursor and set display attributes. Well, maybe it's not so straightforward after all. But doing it isn't the hard part. The hard part is finding out how to do it. THE AMIGA REALLY NEEDS BETTER DOCUMENTATION! --Fabbian Dufoe 350 Ling-A-Mor Terrace South St. Petersburg, Florida 33705 813-823-2350 UUCP: ...uunet!pdn!jc3b21!fgd3