home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 1 / 001.d81 / t.clist < prev    next >
Text File  |  2022-08-26  |  2KB  |  117 lines

  1.             Color Lister
  2.             ----- ------
  3.  
  4. Written by:  Joel Ellis Rea
  5.  
  6.      Colorlist is a tiny machine
  7.  
  8. language routine that makes program
  9.  
  10. listings print to the screen in
  11.  
  12. multiple colors.
  13.  
  14.      Colorlist uses these colors for
  15.  
  16. these keyword classes:
  17.  
  18.  Characters              Default color
  19.  Primary keywords        Light blue
  20.  Secondary keywords      Green
  21.  Operators               Green
  22.  Functions               Orange
  23.  BASIC 4.0 keywords      Purple
  24.  C64-Link keywords       Pink
  25.  Undefined keywords      Cyan
  26.  
  27.      To start COLORLIST, do this:
  28.  
  29.    LOAD"COLORLIST",8,1
  30.  
  31.      Change the text color to the
  32.  
  33. color you want normal text (non-
  34.  
  35. keywords) to print, then type:
  36.  
  37.    SYS 52069
  38.  
  39.      COLORLIST is now active.  If you
  40.  
  41. later want to change the normal text
  42.  
  43. color, do so and then type:
  44.  
  45.    SYS 52091
  46. ......................................
  47.  
  48.    When writing BASIC programs, you
  49.  
  50. may choose to insert spaces between
  51.  
  52. your keywords and variables, etc. in
  53.  
  54. an effort to make your program more
  55.  
  56. readable.  For example:
  57.  
  58. 10 FOR I=1 TO LEN(A$): IF MID$(A$,I,1)
  59. <>" " AND I<5 THEN NEXT I: RETURN
  60.  
  61.    However, you pay a price for such
  62.  
  63. neatness, both in terms of speed and
  64.  
  65. memory space.  In other words, a so-
  66.  
  67. called "neat" program is usually both
  68.  
  69. slower and bigger than one that is
  70.  
  71. written without spaces.  The problem
  72.  
  73. is, the program then becomes nearly
  74.  
  75. un-readable.  For example:
  76.  
  77. 10 FORI=1TOLEN(A$):IFMID$(A$,I,1)<>" "
  78. ANDI<5THENEXTI:RETURN
  79.  
  80.    Can you find the typo in the above
  81.  
  82. line?  How much harder do you think it
  83.  
  84. would be to find the typo if it were
  85.  
  86. embedded in a LONG listing?
  87.  
  88.    I am a stickler for speed and com-
  89.  
  90. pactness in BASIC programs.  I also am
  91.  
  92. not a perfect programmer.  Every once
  93.  
  94. in a while I write programs that don't
  95.  
  96. work right the first time!  Because of
  97.  
  98. my "cramped" style, it is rather time-
  99.  
  100. consuming to try to find the errors in
  101.  
  102. my code.
  103.  
  104.    Thus, I wrote COLORLIST, which is
  105.  
  106. a small (120 bytes long) machine-lan-
  107.  
  108. guage routine that changes the LIST
  109.  
  110. command so that LISTings now appear in
  111.  
  112. multiple colors.  Each keyword becomes
  113.  
  114. color-coded according to its type.
  115.  
  116. --------------------------------------
  117.