home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv7.zip / vac22os2 / ibmcobol / macros / zoom.lx < prev   
Text File  |  1998-02-24  |  1KB  |  37 lines

  1. /* Zoom in on all lines which contain the text which is highlighted */
  2. /* on the current line.                                             */
  3. doagain = 1
  4.  
  5. tryagain:
  6. extract 'content'        /* get the current line                    */
  7.  
  8. extract 'blockstart'     /* find start position of block highlight  */
  9.  
  10. extract 'blockend'       /* find end position of block hightlight   */
  11.  
  12. /* try to ensure we have some text highlighted.                     */
  13. if (blockstart = 0 | blockend = 0 | blockend < blockstart) then do
  14.    if (doagain = 1) then do
  15.       /* no selected text, so get current word */
  16.       'block mark word'
  17.       doagain = 0
  18.       signal tryagain
  19.    end
  20.    else do
  21.       /* error of some sort */
  22.       msg 'No block selected or error selecting word under the cursor'
  23.       exit 2
  24.    end
  25. end
  26.  
  27. 'extract blocktype'
  28. if blocktype = 'STREAM' then
  29.    blockend = blockend - 1
  30.  
  31. /* retrieve the highlighted text only, from the line.               */
  32. text = substr(content, blockstart, blockend - blockstart + 1)
  33.  
  34. 'all find any 'text      /* show only the lines containing the text */
  35.  
  36. exit 0
  37.