home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / KAYPRO / KCHRSET1.LBR / CHRSET11.BQS / CHRSET11.BAS
BASIC Source File  |  2000-06-30  |  6KB  |  220 lines

  1. REM -------- Display Printing & Graphic Characters -------------------\
  2.     \
  3.     Program -  KPCHRSET.BAS \
  4.     \
  5.     Language - CBASIC compiler (CB80) \
  6.     \
  7.     Vers 1.1 \
  8.     \
  9.     Simply displays the printing characters equivalent to \
  10.     the CHR$(33) thru CHR$(255) for the Kaypro video models.\
  11.     \
  12.     Copyright (c) 24-Jun-85 by Steven L. Sanders \
  13.     Tampa Bay KUG \
  14.     14 Cypress Drive \
  15.     Palm Harbor, FL 33563 \
  16.     \
  17.     Portions (c) 1983 by Digital Research \
  18.     \
  19.     Note - CHR$(26) is clear screen/home cursor \
  20.            CHR$(30) is home cursor \
  21.            and most others below 30 are control chrs \
  22.     \
  23.       -------------------- constants ------------------------
  24.  
  25.     clr% =             01ah
  26.     eos% =             017h
  27.     eol% =             018h
  28.     esc% =             01bh
  29.     formfeed% =         0ch
  30.     formfeed$ =         CHR$(formfeed%)
  31.     clr$ =             CHR$(clr%)
  32.     eos$ =             CHR$(eos%)
  33.     eol$ =             CHR$(eol%)
  34.     esc$ =             CHR$(esc%)
  35.     carriage.return% =     0dh
  36.     cr$ =             CHR$(carriage.return%)
  37.     bell$ =         CHR$(07)
  38.     backspace% =         08h
  39.     backspace$ =         CHR$(backspace%)
  40.     bs$ =            CHR$(backspace%)
  41.     space$ =         " "
  42.     null$ =         ""
  43.  
  44. REM ----------------- kaypro graphic routines ----------------------
  45.  
  46.     inv.on$ =     esc$ + "B0"    REM inverse video ON
  47.     inv.off$ =     esc$ + "C0"    REM inverse video OFF
  48.     half.on$ =    esc$ + "B1"    REM half intensity ON
  49.     half.off$ =    esc$ + "C1"    REM half intensity OFF
  50.     blink.on$ =     esc$ + "B2"    REM blinking ON
  51.     blink.off$ =     esc$ + "C2"    REM blinking OFF
  52.     under.on$ =    esc$ + "B3"    REM underline ON
  53.     under.off$ =    esc$ + "C3"    REM underline OFF
  54.     cur.on$ =     esc$ + "B4"    REM cursor ON
  55.     cur.off$ =     esc$ + "C4"    REM cursor OFF
  56.     save.cur$ =     esc$ + "B6"    REM save current cursor position
  57.     rest.cur$ =     esc$ + "C6"    REM restore cursor position
  58.     stat.on$ =     esc$ + "B7"    REM enable status line
  59.     stat.off$ =     esc$ + "C7"    REM disable status line
  60.     pos.cur$ =    esc$ + "=8 "    REM load cursor to col 1 line 25
  61.  
  62. REM ----------------- Kaypro line drawing routines -----------------------
  63.  
  64.     line$ =        esc$ + "L"    REM enable line drawing mode
  65.  
  66. REM these will draw a line around the outside edges of the screen \
  67.     creating a box effect.  draw 1-3 first, add any other print \
  68.     statements before finishing with line4$
  69.  
  70.     line1$ = line$ + CHR$(33) + CHR$(33) + CHR$(33) + CHR$(190)
  71.     line2$ = line$ + CHR$(33) + CHR$(190) + CHR$(130) + CHR$(190)
  72.     line3$ = line$ + CHR$(130) + CHR$(190) + CHR$(130) + CHR$(33)
  73.     line4$ = line$ + CHR$(130) + CHR$(33) + CHR$(33) + CHR$(33)
  74.  
  75. REM ------------------------- functions --------------------------
  76.  
  77. REM position cursor
  78.  
  79.     DEF fn.cursor$(v%,h%)
  80.         PRINT esc$ + "=" + CHR$(v%+32) + CHR$(h%+32);
  81.         RETURN
  82.     FEND
  83.     
  84. REM this function will center a string
  85.  
  86.     DEF fn.center%(data$)
  87.         center% = (80 - LEN(data$))/2
  88.         PRINT TAB(center%);data$;
  89.         RETURN
  90.     FEND
  91.  
  92. REM clears entire screen incl status line
  93.  
  94.     DEF fn.clear.all%
  95.         PRINT stat.off$;
  96.         PRINT clr$;
  97.         RETURN
  98.     FEND
  99.  
  100. REM turns up a clean page under header string
  101.  
  102.     DEF fn.nuscreen%
  103.         PRINT FN.CURSOR$(3,0);eos$;
  104.         RETURN
  105.     FEND
  106.  
  107. REM simple time delay
  108.  
  109.     DEF fn.delay%
  110.         FOR delay1% = 1 TO 300
  111.         FOR delay2% = 1 TO 2000
  112.         NEXT delay2%
  113.         NEXT delay1%
  114.         RETURN
  115.     FEND
  116.  
  117. REM ------------------------ program begins ------------------------
  118.  
  119. info:
  120.     dummy% = fn.clear.all%
  121.  
  122.     PRINT cur.off$+save.cur$+line1$+line2$+line3$+rest.cur$
  123.  
  124.     PRINT:PRINT:PRINT\
  125. "           Just a reminder that users with John Smith's ZCPR2 or"
  126.     PRINT:PRINT\
  127. "           ZCPR3 need to enter GRAF first before running program."
  128.     PRINT:PRINT:PRINT\
  129. "           Kaypro 10 users with BIOSMMR need to enter:"
  130.     PRINT:PRINT\
  131. "                         KSTAT CON=GRAPH"
  132.     PRINT:PRINT:PRINT\
  133. "           If the border line looks funny and is only drawn on half"
  134.     PRINT:PRINT\
  135. "           your screen, you need to follow the above directions."
  136.     PRINT:PRINT:PRINT\
  137. "                     Steven L. Sanders (c) 24-Jun-85"
  138.  
  139.     PRINT line4$
  140.  
  141.     dummy% = fn.delay%
  142.  
  143.     FOR scroll% = 1 TO 25        REM do a Wordstar-style scroll-off
  144.     FOR slow% = 1 TO 1000
  145.     NEXT slow% : PRINT : NEXT scroll%
  146.  
  147.     PRINT cur.on$;
  148.  
  149. start:
  150.  
  151.     group% = 1
  152.     line% = 1
  153.     dummy% = fn.clear.all%
  154.  
  155.     PRINT "       "+inv.on$ + \
  156.     " +++ Kaypro Printing & Graphic Characters Display +++ " + inv.off$
  157.  
  158.     PRINT:PRINT:PRINT\
  159.     "         Display (A)SCII set, (G)raphic set, or (Q)uit? ";
  160.  
  161.     answer% = INKEY
  162.  
  163.     IF UCASE$(CHR$(answer%)) = "Q" \
  164.     THEN PRINT "Quit":PRINT:PRINT:STOP
  165.  
  166.     IF UCASE$(CHR$(answer%)) = "A" \
  167.     THEN x% = 33 : y% = 126 :\
  168.     dummy% = fn.clear.all% :\
  169.     PRINT "         "+inv.on$ + \
  170.     " +++ Kaypro ASCII Printing Characters 33 thru 126 +++ " + inv.off$:\
  171.     GOTO display
  172.  
  173.     IF UCASE$(CHR$(answer%)) <> "G" \
  174.     THEN GOTO start
  175.  
  176.     x% = 127
  177.     y% = 255
  178.  
  179.     dummy% = fn.clear.all%
  180.  
  181.     PRINT "            "+inv.on$ + \
  182.     " +++ Kaypro Graphic Characters 127 thru 255 +++ " + inv.off$
  183.  
  184. display:
  185.  
  186.     PRINT cur.off$;
  187.  
  188.     dummy% = fn.nuscreen%
  189.  
  190.     FOR char% = x% TO y%    REM begin loop
  191.  
  192.     PRINT x%;"= ";CHR$(char%);"   ";
  193.  
  194.     x% = x% + 1        REM increment chr integer
  195.     group% = group% +1    REM increment group integer
  196.  
  197.     IF group% = 8 \        REM print 7 to a line
  198.     THEN group% = 1:\
  199.     line% = line% + 1:\
  200.     PRINT:PRINT        REM and turn up a blank in between lines
  201.  
  202.     IF line% = 11 \        REM print 10 lines per screen
  203.     THEN line% = 1:\
  204.     PRINT blink.on$+"   [ press any key ]"+blink.off$;:\
  205.     dummy% = INKEY:\    REM wait for keypress
  206.     dummy% = fn.nuscreen%    REM start new page under header
  207.  
  208.     NEXT char%        REM get next chr
  209.  
  210.     PRINT:PRINT:PRINT:PRINT\
  211.     blink.on$+"   [ press any key ]"+blink.off$;
  212.  
  213.     dummy% = INKEY
  214.  
  215.     PRINT cur.on$
  216.  
  217.     GOTO start
  218.  
  219. REM --------------------- that's all folks ... -------------------------
  220.