home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / the25.zip / the25O_w32.zip / l.the < prev    next >
Text File  |  1997-09-10  |  3KB  |  70 lines

  1. /*
  2. $Id: l.the 2.1 1995/06/24 16:30:18 MH Rel MH $
  3. */
  4. /***********************************************************************/
  5. /* Description: REXX prefix macro to LOWERCASE a line or block of lines*/
  6. /* Syntax:      nL or Ln or -nL or L-n                                 */
  7. /* Notes:       This macro can also be invoked as a block prefix       */
  8. /*              command by entering LL in the prefix area.             */
  9. /*              For the LL block prefix command to work, you must      */
  10. /*              define LL as a valid prefix synonym with:              */
  11. /*                                                                     */
  12. /*                SET PREFIX SYNONYM LL L                              */
  13. /*                                                                     */
  14. /*              This prefix macro can be used as a template for other  */
  15. /*              prefix macro commands by changing the command to be    */
  16. /*              executed specified on the second line of this macro.   */
  17. /*                                                                     */
  18. /*              This prefix macro is slightly different from the       */
  19. /*              equivalent L Prefix Macro defined in the XEDIT User's  */
  20. /*              Guide:                                                 */
  21. /*                                                                     */
  22. /*              1) The arguments passed to prefix macros contain the   */
  23. /*                 name the macro was invoked with. This is because    */
  24. /*                 the REXX interpreters that THE uses cannot provide  */
  25. /*                 this information from the PARSE SOURCE command.     */
  26. /*                                                                     */
  27. /*              2) THE does not support the target specifiers in the   */
  28. /*                 EXTRACT /PENDING BLOCK command.                     */
  29. /*                                                                     */
  30. /*              3) The check for a whole number as an argument to the  */
  31. /*                 prefix macro has been removed.                      */
  32. /***********************************************************************/
  33. Trace o
  34. the_command = 'LOWERCASE'
  35. Parse Arg pref name func pline op extra
  36. If pref \= 'PREFIX' Then Call error1 'This macro must be called from PREFIX area'
  37. If func = 'CLEAR' Then exit
  38. If func = 'SHADOW' Then Call error1 'Invalid on SHADOW line'
  39. If func \= 'SET' Then Call error1 'This macro must be called from PREFIX area'
  40. If extra \= '' Then Call error1 'Extraneous parameter:' extra
  41. Select
  42.   When Length(name) = 1 Then 
  43.        Do
  44.          If op = '' Then op = 1
  45.          'COMMAND :'||pline the_command op
  46.        End
  47.   When Length(name) = 2 Then
  48.        Do
  49.          If op \= '' Then Call error "Invalid operand:" op
  50.          'COMMAND EXTRACT /PENDING BLOCK' name '/'
  51.          If pending.0 \= 0 Then
  52.             Do
  53.               'COMMAND :'pending.1 'SET PENDING OFF'
  54.               'COMMAND :'pending.1 the_command ':'pline+1
  55.             End
  56.          Else 'COMMAND :'pline 'COMMAND SET PENDING BLOCK' name
  57.        End
  58.   Otherwise Call error "Invalid macro synonym."
  59. End
  60. 'COMMAND CURSOR FILE' pline
  61. Exit
  62.  
  63. error: 
  64. 'COMMAND :'pline 'SET PENDING ERROR' name||op
  65.  
  66. error1: 
  67. Parse Arg t
  68. 'COMMAND EMSG' t
  69. Exit
  70.