home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / UE311CMD.ZIP / PLATIN.CMD < prev    next >
OS/2 REXX Batch file  |  1990-06-19  |  749b  |  41 lines

  1. ;    PLATIN.CMD:    Pig latin translator
  2. ;
  3. ;    This file creates a macro to assist you in translating
  4. ;    english to pig latin.
  5. ;
  6. ;    <F1>    Translate the current word (from the point)
  7. ;    <F2>    Move to the next word
  8.  
  9. 20    store-macro
  10.     end-of-word
  11.     previous-word
  12.     set-mark
  13.     end-of-word
  14.     kill-region
  15.     set %ucase FALSE
  16.     !if &less &asc $kill 96
  17.         set %ucase TRUE
  18.     !endif
  19.     !if ¬ &equ &sindex "aeiou" &left $kill 1 0
  20.         yank
  21.         insert-string "way"
  22.     !else
  23.         yank
  24.         insert-string &left $kill 1
  25.         insert-string "ay"
  26.         previous-word
  27.         delete-next-character
  28.     !endif
  29.     next-word
  30.     previous-word
  31.     !if %ucase
  32.         case-word-capitalize
  33.     !else
  34.         case-word-lower
  35.     !endif
  36.     next-word
  37. !endm
  38.  
  39. bind-to-key execute-macro-20 FN1
  40. bind-to-key next-word FN2
  41.