home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FNTPAK32.ZIP / BASIC.EXE / DEMOBRIT.BAS < prev    next >
BASIC Source File  |  1995-08-16  |  4KB  |  145 lines

  1. DEFINT A-Z
  2.  
  3. '$INCLUDE: 'Font_Pak.Inc'           '... For QB/PDS/VB-DOS
  4.  
  5. '======================================================== PowerBasic Users
  6. ''$INCLUDE "Font_Pak.Inc"             '... PB users, UN-REM these lines
  7.  
  8. ''$Link    "FontPakP.OBJ"             '... SHAREWARE users
  9.  
  10. ''$Link    "Video.OBJ"                '... REGISTERED users
  11. ''$Link    "Fonts.OBJ"                '... REGISTERED users
  12.  
  13. '======================================================== PowerBasic Users
  14.  
  15. '============================================================ DemoBrit.Bas
  16. '
  17. ' A Font Pak Demonstration         Copyright 1991-1994 Rob W. Smetana
  18. '
  19. ' Demonstrate calling BrightBG and DefaultPalette to toggle
  20. ' bright backgrounds on/off -and- selecting a different palette
  21. ' to preserve blinking while also getting bright backgrounds.
  22. '
  23. ' Requires:     - An EGA or VGA monitor.
  24. '
  25. '               - Font_Pak.Lib (QB/PDS/VB-DOS) -or- Font_Pak.PBU (PowerBasic)
  26. '
  27. '
  28. '============================================================ DemoBrit.Bas
  29.  
  30. DECLARE SUB Demo.Bright.Backgrounds ()
  31.  
  32. COLOR 7, 1: CLS
  33.  
  34. CALL fpInitialize                   '=== SHAREWARE versions ONLY
  35.  
  36. Demo.Bright.Backgrounds             '=== demo of Bright Background colors
  37.  
  38. CLS
  39.  
  40. '
  41. SUB Demo.Bright.Backgrounds
  42.  
  43. '==================================== Demo BOTH BrightBG and DefaultPalette
  44.     CLS
  45.  
  46.     PRINT "      This demonstrates CALLing BrightBG (OnorOff) -- Bright Backgrounds."
  47.     LOCATE 25, 34: PRINT "Press a key.";
  48.     d$ = INPUT$(1)
  49.  
  50.     LOCATE 2, 1
  51.  
  52.      Clr = 0: GOSUB PrintIt         'Clr = 0 ===> normal Black
  53.     Clr = 16: GOSUB PrintIt         'Clr =16 ===> blinking Black
  54.  
  55.  
  56.     COLOR 7, 1
  57.     d$ = INPUT$(1)
  58.  
  59.         '=== turn ON bright backgrounds  (use ANY non-zero value)
  60.         CALL BrightBG(1)
  61.  
  62.     d$ = INPUT$(1)
  63.  
  64.         '=== turn OFF bright backgrounds
  65.         CALL BrightBG(0)
  66.  
  67.     d$ = INPUT$(1)
  68.  
  69.  
  70.     CLS
  71.     PRINT "  Now we'll do the same using CALL DefaultPalette (2) -- and preserve blinking."
  72.     LOCATE 25, 34: PRINT "Press a key.";
  73.     d$ = INPUT$(1)
  74.  
  75.     LOCATE 2, 1
  76.  
  77.      Clr = 0: GOSUB PrintIt         'Clr = 0 ===> normal Black
  78.     Clr = 16: GOSUB PrintIt         'Clr =16 ===> blinking Black
  79.  
  80.  
  81.     COLOR 7, 1
  82.     d$ = INPUT$(1)
  83.  
  84.         '=== turn ON bright backgrounds  (in this case, PRESERVE blinking)
  85.         CALL DefaultPalette(2)
  86.  
  87.     d$ = INPUT$(1)
  88.  
  89.         '=== restore the default color palette
  90.         CALL DefaultPalette(0)
  91.  
  92.     d$ = INPUT$(1)
  93.  
  94.     CLS
  95.     PRINT "    Finally, since many people like Dark Blue backgrounds, call DarkBlue . . ."
  96.     LOCATE 25, 34: PRINT "Press a key.";
  97.     d$ = INPUT$(1)
  98.  
  99.     LOCATE 2, 1
  100.  
  101.      Clr = 0: GOSUB PrintIt         'Clr = 0 ===> normal Black
  102.     Clr = 16: GOSUB PrintIt         'Clr =16 ===> blinking Black
  103.  
  104.  
  105.     COLOR 7, 1
  106.     d$ = INPUT$(1)
  107.  
  108.         '=== turn on JUST Dark Blue background
  109.         CALL DarkBlue
  110.  
  111.     d$ = INPUT$(1)
  112.  
  113.         '=== restore the default color palette
  114.         CALL DefaultPalette(0)
  115.  
  116.     d$ = INPUT$(1)
  117.  
  118.  
  119. EXIT SUB
  120.  
  121. '===================================================== do the actual printing
  122. PrintIt:
  123.  
  124.     PRINT : PRINT
  125.  
  126.     Char = 65           '===start with Chr$(65) -- "A"
  127.  
  128.     FOR Back = 0 TO 7
  129.  
  130.         LOCATE , 8
  131.         FOR Fore = Clr TO Clr + 15
  132.  
  133.             COLOR Fore, Back
  134.             PRINT "  "; CHR$(Char); " ";
  135.             Char = Char + 1
  136.  
  137.         NEXT
  138.         PRINT
  139.     NEXT
  140.  
  141. RETURN
  142.  
  143. END SUB
  144.  
  145.