🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by geoffrey liu Sat, 19 Dec 1992 14:28
ansi screen testing.
#407
Author: geoffrey liu
Date: Sat, 19 Dec 1992 14:28
42 lines
1767 bytes
JM>I'm using a PC and writing under DOS, using QuickBasic 4.5 I've got a question:

JM>I am trying to write a piece of code that will test a remote system to see if
JM>that system has ANSI screen codes enabled.  Does anyone have an idea of how to
JM>do such a thing?  Actual code would be great or just an explaination would do.

        Use the following, it should work. If you have any questions,
just yell.

ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄCut HereÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
FUNCTION detect%

'  send out a <ESC>[6n and then look for a reply..
'<ESC>#r;#cR
'r = row, c = column
'Assume that the port is opened as #4
a$ = CHR$(27) + "[6n"
IF online% THEN
    PRINT #4, a$
    SLEEP 1           'important to wait here at least 1 second
    IF online% AND LOC(4) THEN ba$ = INPUT$(LOC(4), 4)
    IF INSTR(ba$, CHR$(27)) > 0 THEN
        PRINT #1, "Ansi detected"  'log file
        a$ = CHR$(27) + "[2J"      'clear screen
        PRINT a$, black%
        detect% = -1
     ELSE
        PRINT #1, "Ansi not detected"
        detect% = 0
    END IF
END IF

END FUNCTION
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄCut HereÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ


                   Happy Holidays, Geoff.
---
 þ DeLuxeý 1.26b #11507 þ Objects in taglines are closer than they appear.
--
Canada Remote Systems  - Toronto, Ontario
World's Largest PCBOARD System - 416-629-7000/629-7044
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads