TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: SANDER SMEENK
from: DAVE NAVARRO
date: 1996-04-08 16:25:00
subject: Ansi Read 1/3

SS>Does someone have sourcecode to read (and display!) ANSI or AVATAR 
screens??
'Converted to PowerBASIC by Dave Navarro, Jr. 'This is a copyrighted file by 
Tom Hanlin which is included in the 'shareware version of BASWIZ.
DEFINT A - Z
Fore = 7
Back = 0
St$ = CHR$( 27 ) + "[2J"
AnsiPrintChars St$
OPEN "I", 1, "CHESS.ANS"
  WHILE NOT EOF( 1 )
    LINE INPUT#1, St$
    St$ = St$ + CHR$( 13, 10 )
    AnsiPrintChars St$
  WEND
CLOSE 1
SUB AnsiPrintChars( BYVAL St$ )
  FOR disp = 1 TO LEN( St$ )
    ch$ = MID$( St$, disp, 1 )
    AnsiPrint ch$
  NEXT
END SUB
SUB AnsiPrint( BYVAL Ch$ )
  STATIC ANSIst$, ANSIcode, Row, Col, SaveRow, SaveCol, Fore, Back
  STATIC First
  SHARED Music
  IF First = 0 THEN
    Fore = 7
    Back = 0
    First = -1
  END IF
  IF ANSIcode THEN
    IF LEFT$( ANSIst$, 2 ) = "[M" THEN
      IF ASC( ch$ ) = 14 THEN
        IF Music THEN PLAY "MB" + MID$( ANSIst$, 4 )
        ANSIst$ = ""
        ANSIcode = 0
      ELSE
        ANSIst$ = ANSIst$ + ch$
      END IF
    ELSEIF INSTR( "ABCDEFGHIJKLMNOPQRSTUVWXYZ", UCASE$( ch$ )) THEN
      SELECT CASE ch$
        CASE "A": GOSUB CursorUp
        CASE "B": GOSUB CursorDown
        CASE "C": GOSUB CursorRight
        CASE "D": GOSUB CursorLeft
        CASE "H", "f": GOSUB CursorLocate
        CASE "s": GOSUB SaveCursorPosn
        CASE "u": GOSUB RestCursorPosn
        CASE "J": GOSUB BigErase
        CASE "K": GOSUB SmallErase
        CASE "h", "l": REM set display mode... ignored
        CASE "m": GOSUB SetColors
        CASE ELSE
          PRINT ANSIst$;
          ANSIcode = 0
          ANSIst$ = ""
      END SELECT
      ANSIst$ = ""
      ANSIcode = 0
    ELSEIF ASC( ch$ )  60 THEN
      PRINT ANSIst$;
      ANSIcode = 0
      ANSIst$ = ""
    ELSE
      ANSIst$ = ANSIst$ + ch$
    END IF
  ELSEIF ASC( ch$ ) = 27 THEN
    ANSIcode = -1
    ANSIst$ = ""
  ELSEIF ASC( ch$ ) = 13 THEN
    LOCATE CSRLIN, 1
  ELSEIF ASC( ch$ ) = 10 THEN
    Tmp = POS( 0 )
    PRINT
    LOCATE, Tmp
  ELSE
    PRINT ch$;
  END IF
  EXIT SUB
CursorUp:
  Tmp = VAL( MID$( ANSIst$, 2 ))
(Continued to next message)
---
 * QMPro 1.53 * MicroSoft finally got something right, BANKRUPTCY! 
--- InterEcho 1.18
---------------
* Origin: Toast House * (314) 994-0312 * (1:100/560)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.