TEXT WINDOW

 BBS: Inland Empire Archive
Date: 03-30-93 (09:22)             Number: 341
From: DOUGLAS LUSHER               Refer#: NONE
  To: JIM COYLE                     Recvd: NO  
Subj: TEXT WINDOW                    Conf: (2) Quik_Bas
JC>DL>> I haven't tried this and I never have done much with ANSI.SYS so I
JC>DL>> can't guarentee that it will work, but here's a thought: DOS has
JC>DL>> specific file handles assigned to the five (I think) primary devices.
JC>DL>> And I'm not talking BASIC file numbers here, I'm talking actual DOS
JC>DL>> file handles - they're different. And any DOS tech manual should tell
JC>DL>> you the file handle number for the console. So when ANSI.SYS is
JC>DL>> installed, the console file handle must be changed to point to ANSI.
JC>DL>> And the console device is always open, isn't it? So why not use
JC>interrupt
JC>DL>> 21 function 40 to write to the console device? It would be a piece of
JC>DL>> cake

JC>Yeah. Someone else suggested this but I didn't know the interrupt cause I
JC>have  no list.  I'll see if I can figure it out! Thanks.
JC>Jim..

Well, let me see if I can put something together.
Load QB with the /L switch, and do a '$INCLUDE: 'QB.BI' right away.

SUB Print2Console(Stuff$)
DIM XRegister AS RegTypeX

XRegister.AX = &H4000          'this is the function we want
XRegister.BX = 1               'handle for console Stdout
XRegister.CX = LEN(Stuff$)     'the number of bytes to write
XRegister.DS = VARSEG(Stuff$)  'point to the stuff to be written
XRegister.DX = SADD(Stuff$)    '  "    "  "    "    "  "    "
CALL InterruptX(&H21, XRegister, XRegister)

END SUB

See if that SUB will do it for you, Jim. I'll be interested to
know if it works.

---
 þ SLMR 2.1a þ Better living through alchemy.

--- TMail v1.30.4
 * Origin: TC-AMS MLTBBS 2.2 - Minnetonka, MN (612)-938-4799 (1:282/7)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET