'>>> Page 1 of LOADANSI.BI begins here. TYPE:BAS
REM ******************************************************
REM * Filespec : loadansi.bas loadansi.bi testansi.bas *
REM * : ansicolr.bas *
REM * Date : July 21 1997 *
REM * Time : 12:05 *
REM * Revision : 1.01B *
REM * Update : March 12 1998 *
REM ******************************************************
REM * Programmer: Nigel Traves *
REM * Address : 5 Breamer Road, Collingham, Newark, *
REM * : Notts, U.K. *
REM * Post Code : NG23 7PN *
REM ******************************************************
REM * Released to the Public Domain *
REM ******************************************************
REM ******************************************************************
REM * This little library is designed to take the tedium out of *
REM * writing code that uses ANSI.SYS for screen control. Each of *
REM * the public routines in this library works in the same way in *
REM * that the required ANSI escape sequence is appended (i.e. put *
REM * at the end of) onto the string AString$ that is a parameter *
REM * for each of them. Once you have built the string with all of *
REM * the ANSI codes that you want, you will need to send them to *
REM * "the standard output" as it is termed. For those that don't *
REM * know, standard output is a way of treating the video screen as *
REM * though it were a file. To do this in QuickBasic you have to *
REM * use a special version of the OPEN command as follows: *
REM * *
REM * OPEN "CONS:" FOR OUTPUT AS #1 *
REM * *
REM * And then you output your string as though sending it to a file *
REM * like so: *
REM * *
REM * PRINT #1,ansiSequence$ *
REM * *
REM * WARNING - User error trapping in this library is crude, all *
REM * that happens is that if a parameter is found to be *
REM * unacceptable, STOP is called *without* any error *
REM * message being displayed. This is done purely for *
REM * source code size. It is left up to you to add *
REM * better error trapping. Have fun! *
REM ******************************************************************
REM ******************************************************************
REM * Use the following constants for specifying desired colours *
REM * in the three routines that set colours, remembering that *
REM * you normally cannot have a background colour greater than *
REM * white *
REM ******************************************************************
CONST Black% = 0, Blue% = 1, Green% = 2, Cyan% = 3, Red% = 4
CONST Magenta% = 5, Brown% = 6, White% = 7, Grey% = 8, LightBlue% = 9
CONST LightGreen% = 10, LightCyan% = 11, LightRed% = 12, LightMagenta%_
= 13
CONST Yellow% = 14, BrightWhite% = 15
REM ******************************************************************
REM * Most of the routines have an obvious function, so I will only *
REM * detail those that may not be quite so obvious from their name. *
REM ******************************************************************
DECLARE SUB ScreenCodeToANSI ( ScreenCode%, AString$ )
REM ******************************************************************
REM * ScreenCode% holds the equivalent of a single screen character *
REM * location. This routine converts such a code to an equivalent *
REM * ANSI string which is appended to the end of AString$. *
REM ******************************************************************
DECLARE SUB AddANSICLS ( AString$ )
DECLARE SUB AddHomeCursor ( AString$ )
DECLARE SUB AddMoveCursor ( AString$, ToX%, ToY% )
DECLARE SUB AddMoveCursorUp ( AString$, By% )
DECLARE SUB AddMoveCursorDown ( AString$, By% )
DECLARE SUB AddMoveCursorRight ( AString$, By% )
DECLARE SUB AddMoveCursorLeft ( AString$, By% )
DECLARE SUB AddSaveCursor ( AString$ )
DECLARE SUB AddRestoreCursor ( AString$ )
DECLARE SUB AddClearEOL ( AString$ )
REM ******************************************************************
REM * Clears the line that the cursor is on, from the cursor's *
REM * position to the end of the line, hence EOL. *
'>>> Page 1 of LOADANSI.BI ends here. Continued on next page.
-+- OLMS 2.53 UNREG
---
---------------
* Origin: Most Wanted BBS +44 (0)1522 887627 & 887628 * (2:2503/509)
|