home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 13
/
CD_ASCQ_13_0494.iso
/
maj
/
419
/
getcolor.bas
< prev
next >
Wrap
BASIC Source File
|
1994-03-13
|
1KB
|
25 lines
' +----------------------------------------------------------------------+
' | |
' | PBClone Copyright (c) 1990-1994 Thomas G. Hanlin III |
' | |
' +----------------------------------------------------------------------+
DECLARE SUB UnCalcAttr (Foreground%, Background%, BYVAL VAttr%)
SUB GetColor (Fore%, Back%)
Row% = CSRLIN ' get current cursor position
Col% = POS(0)
Ch$ = CHR$(SCREEN(1, 1)) ' save char and colors at 1, 1
VAttr% = SCREEN(1, 1, 1)
LOCATE 1, 1 ' print char there in current color
PRINT Ch$;
DefAttr% = SCREEN(1, 1, 1) ' get the current default color
UnCalcAttr Fore%, Back%, VAttr% ' restore the old color
COLOR Fore%, Back%
LOCATE 1, 1
PRINT Ch$;
LOCATE Row%, Col%
UnCalcAttr Fore%, Back%, DefAttr% ' return the current default color
COLOR Fore%, Back% ' restore it as the default
END SUB