Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
COLOR fg, bg
#1
The QuickBASIC Help, Index, COLOR statement, double click, shows that, for SCREEN 11-13, COLOR only allows the foreground color, thus:
COLOR foreground.

But, if we use this first
WIDTH 80,25 'or 30, or 43, or 60
we can then use
COLOR foreground, background
Furthermore, the foreground (or background) colors aren't limited to 0-7, but can be 0-31. How about that? This enables a blinking foreground.

I don't remember using or seeing this used before. Is this something new for most QBers here, or is this just old stuff?
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#2
old stuff
Reply
#3
Up to 31 colors? I can't see how!
PC text Screen attributes save the foreground color in one byte per character: 4 bits for foreground and 4 bits for background. This gives 15 colors for foreground and 15 for background. The 7 upper colors for the foreground are bright colors, while for background you can set a bit somewhere to decide if the 7 upper colors are bright or blinking.
This is how the BIOS text screen works, and how Windows should emulate it
Antoni
Reply
#4
Antoni:

Sorry that I said "31 colors". What I meant was that we could use 0-31 for the foreground numbers following the COLOR statement, giving the 0-7 colors, 8-15 "bright", or "light" colors, and, by using any of those 0-15 colors with the addition of 16 (which gives the 16-31), those first 0-15 colors are blinked on and off.

I found that, for the background, only 0-15 could be used.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)