Ansi colors

 BBS: Inland Empire Archive
Date: 12-28-92 (23:19)             Number: 353
From: JIM MOREY                    Refer#: NONE
  To: PHILLIP STORM                 Recvd: NO  
Subj: Ansi colors                    Conf: (2) Quik_Bas
'ANSI color printing example 1
'
'The screen must be opened as a file for output and printed to.  BASIC's
'PRINT statement prints directly, thus bypassing ANSI.SYS.
'
'Another point to note: A standard (of your choosing) must be
'established when combining various ANSI options.  The order of the
'colors and highlighting codes is unimportant, so long as the sequence
'begins with the escape and ends with the 'm' and is separated by a ';'.
'The standard chosen below is to insert the highlighting codes between
'the escape and the colors, with the colors containing the 'm'
'parameter, and the highlighting codes containing the ';' separator.
'Your milage may vary.

esc$=chr$(27)+"["

normal$   = "0m"
blinking$ = "5;"
bold$     = "1;"

red$      = "31m"
green$    = "32m"
yellow$   = "33m"
blue$     = "34m"
magenta$  = "35m"
cyan$     = "36m"
white$    = "37m"

open "O",#1,"cons:"

cls
print #1, esc$+red$+"red"
print #1, esc$+green$+"green"
print #1, esc$+yellow$+"yellow"
print #1, esc$+blue$+"blue"
print #1, esc$+magenta$+"magenta"
print #1, esc$+cyan$+"cyan"
print #1, esc$+white$+"white"
print #1, esc$+normal$+"normal"
print #1,

print #1, esc$+bold$+red$+"bold red"
print #1, esc$+bold$+green$+"bold green"
print #1, esc$+bold$+yellow$+"bold yellow"
print #1, esc$+bold$+blue$+"bold blue"
print #1, esc$+bold$+magenta$+"bold magenta"
print #1, esc$+bold$+cyan$+"bold cyan"
print #1, esc$+bold$+white$+"bold white"
print #1, esc$+normal$+"normal"
print #1,
print #1, "Press a key..."
dummy$=input$(1)

cls
print #1, esc$+blinking$+red$+"blinking red"
print #1, esc$+blinking$+green$+"blinking green"
print #1, esc$+blinking$+yellow$+"blinking yellow"
print #1, esc$+blinking$+blue$+"blinking blue"
print #1, esc$+blinking$+magenta$+"blinking magenta"
print #1, esc$+blinking$+cyan$+"blinking cyan"
print #1, esc$+blinking$+white$+"blinking white"
print #1, esc$+normal$+"normal"
print #1,

print #1, esc$+bold$+blinking$+red$+"bold blinking red"
print #1, esc$+bold$+blinking$+green$+"bold blinking green"
print #1, esc$+bold$+blinking$+yellow$+"bold blinking yellow"
print #1, esc$+bold$+blinking$+blue$+"bold blinking blue"
print #1, esc$+bold$+blinking$+magenta$+"bold blinking magenta"
print #1, esc$+bold$+blinking$+cyan$+"bold blinking cyan"
print #1, esc$+bold$+blinking$+white$+"bold blinking white"
print #1, esc$+normal$+"normal"
print #1,
print #1, "Press a key..."
dummy$=input$(1)

locate 20,1
end


--- DCI/Chauncy 0.6a
 * Origin: The Bowling Alley - Tampa, FL (813)876-4493 (1:377/21.0)
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