home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / kl.zip / KLMouse.kex < prev    next >
Text File  |  1997-03-17  |  903b  |  30 lines

  1. *  KEDIT Macro: KL Mouse for KL macro                      Version. 1.0
  2. *
  3. *  Author: Shintaroh Hori  (Yamato Lab, IBM Japan)
  4. *
  5. 'editv getf KLIND KLSPEC.0'
  6. if klind \=1 then Return 0 /* do nothing for non-KL file */
  7.  
  8. parse arg klcmd
  9. 'extract /click' ; if rc\=0 then Return 1+rc
  10. if click.2 <= klspec.0 then /* On a File Specifier line */ do
  11.    if click.1=1 then 'KEDIT -'; else 'KEDIT'
  12.    rc=1 /* Normal completion */
  13. end
  14. else if click.2 = klspec.0 +1 then /* On a field Description line */ do
  15.    pos = click.3
  16.    'editv getf klflds'
  17.    do while klflds\=''
  18.       parse var klflds fld fb fe klflds
  19.       if pos < fb then iterate
  20.       if pos > fe then iterate
  21.       if click.1=1 then so='-'; else so=''
  22.       'macro KL /S'so || fld  /* Sort */
  23.       leave
  24.    end
  25. end
  26. else if klcmd \=''  then do
  27.    'macro KL /EX' klcmd  /* Execute a given KL command for a file */
  28. end
  29. Exit rc
  30.