BBS: Inland Empire Archive Date: 06-23-92 (18:26) Number: 1249 From: RON PIERCE Refer#: NONE To: JIM COYLE Recvd: NO Subj: Detecting ansi Conf: (2) Quik_Bas
JC> I was wondering if anyone out there knew how to detect ANSI
JC> Color graphics. The only way I could think of doing this was to
Jim, here is something to help you along...
' Ansi Detection Routine for FeatherNet BBS
' =========================================
' DEFINT A-Z ' At the beginning of program
' CONST True = -1, False = NOT True, Nul$ = ""
' "ComPrint" sends data to the active serial port
' "ComLOC" is the number of characters in the serial receive buffer
' "ComINPUT$" retrieves a number of bytes from the serial receive
buffer
' ********************************************************************
Ansidet = False
b$ = Nul$
FOR Count% = 1 TO 5 ' Try this 5 times if needed
Comprint "[6n" ' Send ANSI Status Request to COM Port
Delay 1 ' Wait 1 second
IF Comloc THEN
a$ = ComINPUT$(Comloc) ' Get ALL data waiting
b$ = b$ + a$ ' Add to b$
IF INSTR(b$,"") THEN ' Check b$ for status
' request response
IF INSTR(UCASE$(b$),"R") THEN
Ansidet = True
EXIT FOR
END IF
END IF
END IF
NEXT Count% '
************************************************************
*******
Ron
* SLMR 2.1a #1376 * Nothing is so smiple that it can't get screwed up.
--- VP [DOS] V4.09e
* Origin: The Programmer's Inn - FeatherNet Home (619)446-4506 HST (1:10/301)

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