🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.basic
Article #407

ansi screen testing.

#407
From: 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
Technical Details
Message-ID: <1992Dec19.3061.1115@dosgate>
Path: arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!canrem!dosgate!dosgate![geoffrey.liu@canrem.com]

Show Full Headers
Complete Article Headers
Newsgroups: alt.lang.basic
Path: arc1-ca.pugleaf.net!sparky!uunet!uunet.ca!canrem!dosgate!dosgate![geoffrey.liu@canrem.com]
From: "geoffrey liu" <geoffrey.liu@canrem.com>
Subject: ansi screen testing.
Message-ID: <1992Dec19.3061.1115@dosgate>
Reply-To: "geoffrey liu" <geoffrey.liu@canrem.com>
Organization: Canada Remote Systems
Distribution: alt
Date: 19 Dec 92 09:28:01 EST
Lines: 42