home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / wp / bmacs.zip / CCASE.M < prev    next >
Text File  |  1989-01-01  |  3KB  |  135 lines

  1. ;**
  2. ;**        BRIEF -- Basic Reconfigurable Interactive Editing Facility
  3. ;**
  4. ;**        Written by Dave Nanian and Michael Strickman.
  5. ;**
  6.  
  7. ;**
  8. ;**   macros : lcase_word, inq_eoln, ucase_word
  9. ;**   
  10. ;** 
  11. ;**
  12. ;**   D. Lane 13 October 1987
  13. ;*******************************************************
  14. ;**
  15. ;**   Moved key assignments to initials macro. Makes it easier to keep
  16. ;**   track of reconfigured keystrokes. Used autoload to load ccase when
  17. ;**   one of these macros arfe called. 
  18. ;**
  19. ;**   Jake Colman 2 Feb 1988
  20. ;*******************************************************
  21.  
  22. ;**  (macro ccase
  23. ;**
  24. ;**  Key assignments
  25. ;**
  26. ;**   (
  27. ;**        (assign_to_key "<Alt-F7>" "ucase_word")
  28. ;**        (assign_to_key "<Alt-F8>" "lcase_word")
  29. ;**   )
  30. ;**)
  31.  
  32. (macro lcase_word
  33. ;**
  34. ;** converts next word to lower case
  35. ;**
  36.     (
  37.         (string ichar)
  38.         (= ichar (read 1)) ;** read character
  39.  
  40. ;** skips past blanks
  41.  
  42.         (while (&& (== ichar " ") (!= (inq_eoln) 1)) ;** not equal blank and not eoln
  43.               (
  44.                 (move_rel 0 1)
  45.                 (= ichar (read 1))
  46.               )
  47.         )
  48.  
  49.  
  50.         (while (&& (!= ichar " ") (!= (inq_eoln) 1)) ;** not equal blank and not eoln
  51.             (
  52.                  (delete_char)
  53.                 (insert (lower ichar))
  54.                 (= ichar (read 1))
  55.             )
  56.         )
  57.  
  58.     )
  59. )
  60.  
  61. ;**
  62. ;**        BRIEF -- Basic Reconfigurable Interactive Editing Facility
  63. ;**
  64. ;**        Written by Dave Nanian and Michael Strickman.
  65. ;**
  66. ;**     BRIEF macro  inq_eoln by DAL 
  67. ;** 
  68. ;**    purpose : returns : 0 if * not * at end of line.
  69. ;**                        1 if at end of line.
  70. ;**
  71. ;**     written Sept 1987
  72.  
  73. (macro inq_eoln
  74.     (
  75.          (int cur_col)
  76.          (int end_col)
  77.          (int return_var)
  78.  
  79.          (= return_var 0)
  80.  
  81.          (inq_position NULL cur_col)
  82.          
  83.          (end_of_line)
  84.  
  85.          (inq_position NULL end_col)
  86.  
  87.          (move_abs 0 cur_col)
  88.  
  89.          (if (>= cur_col end_col)
  90.               (
  91.               (= return_var 1)
  92.               )
  93.          )
  94.          (returns return_var)
  95.  
  96.     )
  97. )
  98.  
  99.  
  100. ;**
  101. ;**
  102. ;**   D. Lane 13 October 1987
  103.  
  104.  
  105.  
  106. (macro ucase_word
  107. ;**
  108. ;** converts next word to UPPER case
  109. ;**
  110.     (
  111.         (string ichar)
  112.         (= ichar (read 1)) ;** read character
  113.  
  114. ;** skips past blanks
  115.  
  116.         (while (&& (== ichar " ") (!= (inq_eoln) 1)) ;** not equal blank and not eoln
  117.               (
  118.                 (move_rel 0 1)
  119.                 (= ichar (read 1))
  120.               )
  121.         )
  122.  
  123.  
  124.         (while (&& (!= ichar " ") (!= (inq_eoln) 1)) ;** not equal blank and not eoln
  125.             (
  126.                  (delete_char)
  127.                 (insert (upper ichar))
  128.                 (= ichar (read 1))
  129.             )
  130.         )
  131.  
  132.     )
  133. )
  134.  
  135.