home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d07xx / d0770.lha / Uedit / KenPerano.LZH / Config!E < prev    next >
Text File  |  1989-03-29  |  7KB  |  230 lines

  1. ======= Extra Commands =======
  2.  
  3. Process all INCLUDE files
  4. <shftAltCtl-f1:           ..   K. Perano
  5.      moveCursor(curFile,eFile)  .. reverse search allows for include at sFile
  6.      setSearch("include")
  7.      while (search(curFile,locA,locB,-1)) {
  8.        moveCursor(curFile,locA)
  9.    
  10.        moveCursor(curFile,eWord)
  11.        while (is(curFile,space)) moveCursor(curFile,eChar)  
  12.        equateLoc(curFile,locA,atCursor)  .. start of possible file name.
  13.  
  14.        while (nothing) {
  15.          if ( is(curFile,whiteSpace)) goto label(1) .. break
  16.          if ( is(curFile,eFile)) goto label(1)      .. break
  17.          moveCursor(curFile,eChar)
  18.          }
  19.      label(1)
  20.        equateLoc(curFile,locB,atCursor)  .. end of possible file name.
  21.    
  22.        freeBuf(buf45)
  23.        insertRgn(buf45,sFile,curFile,loc)
  24.    
  25.        if (not is(curFile,eline)) moveCursor(curFile,eline)
  26.        equateLoc(curFile,locB,atCursor)  .. end of include line
  27.        moveCursor(curFile,sline)
  28.        equateLoc(curFile,locA,atCursor)  .. beginning of include line
  29.       
  30.        if (moveCursor(curFile,sChar)) {  .. delete include line if found file
  31.          if (insertFile(curFile,locA,buf45)) clearRgn(curFile,loc)
  32.          }
  33.        else {        .. "include" keyword at sFile case
  34.          if (insertFile(curFile,locA,buf45)) clearRgn(curFile,loc)
  35.          moveCursor(curFile,sFile)
  36.          }
  37.        } >
  38.  
  39. Mark cursor location with a unique ASCII marker
  40. <alt-.: insertRgn(curFile,atCursor,"<cursor>",char) > ..  K. Perano
  41.  
  42. Find and remove marker
  43. <alt-/:                   ..  K. Perano
  44.      setSearch("<cursor>")
  45.      if (search(curFile,locA,locB,1))
  46.        clearRgn(curFile,loc)
  47.      else if (search(curFile,locA,locB,-1))
  48.        clearRgn(curFile,loc)
  49.      else
  50.        putMsg("Not found") 
  51.      setSearch(buf49) >
  52.  
  53. Change case of Hilite region
  54. <shftctl-f:                         ..  K. Perano
  55.      locToIndex(curFile,n2,sHilite)
  56.      locToIndex(curFile,n3,eHilite)
  57.      decNum(n3)
  58.      if (geNum(n3,n2)) {
  59.        moveCursor(curFile,sHilite)
  60.        do (n1,n2,n3) {
  61.          if (is(curFile,upperCase)) toLower(curFile)
  62.          else toUpper(curFile)
  63.          moveCursor(curFile,eChar)
  64.          }
  65.        refreshDisplay
  66.      }>
  67.  
  68. Copy Hilite region to file
  69. <altCtl-f:                   ..  K. Perano
  70.     if (gtLoc(curFile,eHilite,sHilite)) {
  71.       if (getFlag(curFile,columnar)) flipFlag(curFile,columnar)
  72.       freeBuf(buf47) insertRgn(buf47,sFile,curFile,hilite)
  73.       equateLoc(buf47,sPage,sFile)
  74.       putMsg("Save Hilite as file:")
  75.       freeBuf(buf43)
  76.       if (inputString(buf43))
  77.         if (setFileName(buf47,buf43)) {
  78.           saveFile(buf47)
  79.           setFileName(buf47,"Copied Hilite")
  80.         }
  81.     }
  82.     else returnFalse >
  83.  
  84. Convert Hilite region to lower case
  85. <shftctl-l:                          ..  K. Perano
  86.      locToIndex(curFile,n2,sHilite)
  87.      locToIndex(curFile,n3,eHilite)
  88.      decNum(n3)
  89.      if (geNum(n3,n2)) {
  90.        moveCursor(curFile,sHilite)
  91.        do (n1,n2,n3) {
  92.          toLower(curFile)
  93.          moveCursor(curFile,eChar)
  94.          }
  95.        refreshDisplay
  96.      }>
  97.  
  98. Transpose previous two characters
  99. <alt-t:                             ..  K. Perano
  100.       moveCursor(curFile,sChar)
  101.       copyChar(curFile,n2)
  102.       moveCursor(curFile,sChar)
  103.       copyChar(curFile,n1)
  104.       swapChar(curFile,n2)
  105.       moveCursor(curFile,eChar)
  106.       swapChar(curFile,n1)
  107.       moveCursor(curFile,eChar) >
  108.       
  109. Convert Hilite region to upper case
  110. <shftctl-u:                          ..  K. Perano
  111.      locToIndex(curFile,n2,sHilite)
  112.      locToIndex(curFile,n3,eHilite)
  113.      decNum(n3)
  114.      if (geNum(n3,n2)) {
  115.        moveCursor(curFile,sHilite)
  116.        do (n1,n2,n3) {
  117.          toUpper(curFile)
  118.          moveCursor(curFile,eChar)
  119.          }
  120.        refreshDisplay
  121.      }>
  122.  
  123. Copy all lines containing "string" to "buffer"
  124. <altCtl-w:                         .. K. Perano
  125.             equateNum(n1,curFile)
  126.             putMsg("Save in buffer:")
  127.             freeBuf(buf43)
  128.             if (inputString(buf43)) {
  129.               newFile
  130.               setFileName(curFile,buf43)
  131.               equateNum(n2,curFile)
  132.               editBuf(buf[n1])
  133.               }
  134.             else
  135.               returnFalse
  136.             putMsg("Input search string:")
  137.             freeBuf(buf49)
  138.             if (inputString(buf49)) {
  139.               moveCursor(curFile,sFile)
  140.               setSearch(buf49)
  141.               while (search(curFile,locA,locB,1)) {
  142.                 if (not is(curFile,sline)) moveCursor(curFile,sline)
  143.                 insertRgn(buf[n2],eFile,curFile,line)
  144.                 insertChar(buf[n2],eLine)
  145.                 moveCursor(curFile,downLine)
  146.                 }
  147.               }
  148.             else
  149.               returnFalse >
  150.  
  151. Show current search string
  152. <shftAlt-.:    putMsg(buf49) >                        .. K. Perano
  153.  
  154. Set current search string to hilite.
  155. <shftAlt-,:    freeBuf(buf49)                         .. K. Perano
  156.                insertRgn(buf49,sFile,curFile,hilite)
  157.                setSearch(buf49)
  158.                putMsg(buf49) >
  159.  
  160. Show current replace string
  161. <shftAltCtl-.:    putMsg(buf48) >                     .. K. Perano
  162.  
  163. Set current replace string to hilite.
  164. <shftAltCtl-,:    freeBuf(buf48)                      .. K. Perano
  165.                insertRgn(buf48,sFile,curFile,hilite)
  166.                putMsg(buf48) >
  167.  
  168. Process substitution list
  169. <shftAlt-s:                                           .. K. Perano
  170.      equateNum(n1,curFile)
  171.      putMsg("Substitution buffer: ")   .. get name of substitution buffer
  172.      if (inputNum(n2)) {
  173.        moveCursor(buf[n2],sFile)
  174.        }
  175.      else
  176.        returnFalse
  177.      while (runKey(shftaltCtl-s)) {     .. get substitution pair
  178.        moveCursor(curFile,sFile)
  179.        while (search(curFile,locA,locB,1)) {
  180.          clearRgn(curFile,loc)
  181.          insertRgn(curFile,locA,buf48,all)
  182.          }
  183.        } >
  184.  
  185. <shftaltCtl-s:                                      .. K. Perano
  186.        clearRgn(buf48,all)
  187.        clearRgn(buf49,all)
  188.  
  189.        editBuf(buf[n2])
  190.        if ( not is(curFile,eFile)) {
  191. ...      find and load search string
  192.          while (is(curFile,space)) moveCursor(curFile,eChar)  
  193.          equateLoc(curFile,locA,atCursor)  .. start of search string
  194.  
  195.          while (nothing) {
  196.            if ( is(curFile,whiteSpace)) goto label(1) .. break
  197.            if ( is(curFile,eFile)) goto label(1)      .. break
  198.            moveCursor(curFile,eChar)
  199.            }
  200.        label(1)
  201.          equateLoc(curFile,locB,atCursor)  .. end of search string
  202.          insertRgn(buf49,sFile,curFile,loc)
  203.          setSearch(buf49)
  204.  
  205. ...      find and load replace string
  206.          while (is(curFile,space)) moveCursor(curFile,eChar)  
  207.          equateLoc(curFile,locA,atCursor)  .. start of replace string
  208.  
  209.          while (nothing) {
  210.            if ( is(curFile,whiteSpace)) goto label(2) .. break
  211.            if ( is(curFile,eFile)) goto label(2)      .. break
  212.            moveCursor(curFile,eChar)
  213.            }
  214.        label(2)
  215.          equateLoc(curFile,locB,atCursor)  .. end of replace string
  216.          insertRgn(buf48,sFile,curFile,loc)
  217.  
  218. ....     position cursor at start of next line
  219.          if (not is(curFile,eline)) moveCursor(curFile,eline)
  220.          moveCursor(curFile,eChar)
  221.  
  222.          editBuf(buf[n1])
  223.          returnTrue
  224.          }
  225.        else {
  226.          editBuf(buf[n1])
  227.          returnFalse
  228.          }
  229.        >
  230.