home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
BASIC
/
BCC101
/
QBCODE
/
ZPRINT.BAS
< prev
Wrap
BASIC Source File
|
1993-03-20
|
2KB
|
53 lines
'*********************************************************************
'* FileName: ZPrint by Lee Herron @ 1:3612/130 fido *
'* Copyright 1993 by Lee Herron *
'* ----------------------------------------------------------------- *
'* Description: For use in coding color into large text displays, *
'* much quicker method of changing colors than using color ?,? *
'* everytime. I hope you find it of some help. Hint: Don't use zPrint*
'* on every line. *
'* Origin: NightFlight BBS Pensacola,FL 16.8HST/DS (1:3612/130) *
'*********************************************************************
DEFINT A-Z
DECLARE SUB zPrint (z$)
' ASCII TABLE:
'128 Ç black '136 ê hblack
'129 ü blue '137 ë hblue
'130 é green '138 è hgreen
'131 â cyan '139 ï hcyan
'132 ä red '140 î hred
'133 à magenta '141 hmagenta
'134 å brown '142 Ä hbrown
'135 ç white '143 Å hwhite
CLS
LOCATE 11, 6
zPrint "éÇThis is a sample string using èÇ<ÄÇZPrintèÇ>éÇ to "
PRINT "Highlight specific words!" ' see Hint !
SUB zPrint (z$) STATIC
y = CSRLIN: x = POS(0): cflag = 0
FOR z = 1 TO LEN(z$)
a = ASC(MID$(z$, z, 1)): m$ = CHR$(a)
IF a = 145 THEN
PRINT
ELSE
IF a < 128 THEN
PRINT m$;
cflag = 0
ELSE
IF cflag THEN
COLOR , a - 128: cflag = 0
'Set background color because previous character was a color.
ELSE
COLOR a - 128: cflag = 1
'Set foreground color because prev. char was a letter.
END IF
END IF
END IF
NEXT z
END SUB