Re: ANSI cursor location

 BBS: Inland Empire Archive
Date: 01-06-93 (19:32)             Number: 365
From: BOB PERKINS                  Refer#: NONE
  To: JAMES VAHN                    Recvd: NO  
Subj: Re: ANSI cursor location       Conf: (2) Quik_Bas
 JV> I'd like to use the ANSI.SYS driver to tell me what the current
 JV> cursor location is, but apparently CONS: is OUTPUT only from QB???

 JV> Does anyone have a solution?

  I made it work by using DOS interrupts, but I could'nt
find a way to make it work via QB's internals.  This sends
the string to stdout, and then gathers characters from
stdin (without echo) until it sees an ASCII 82 ("R") which
terminates the ansi return sequence.

  '$INCLUDE: 'qb.bi'
  DIM regs AS regtype
  outstring$ = CHR$(27) + "[6n" + CHR$(13) + CHR$(10)
  FOR x% = 1 TO LEN(outstring$)
    regs.ax = &H600
    regs.dx = ASC(MID$(outstring$, x%, 1))
    interrupt &H21, regs, regs
  NEXT x%
  '
  DO
   regs.ax = &H700
   interrupt &H21, regs, regs
   char% = regs.ax AND &HFF
   returnstring$ = returnstring$ + CHR$(char%)
  LOOP UNTIL char% = 82
  '
  PRINT "Return String = "; returnstring$



--- Msg V4.5
 * Origin: Reciprocity Failure  (1:124/4115.236)
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