home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d7xx / d770 / uedit.lha / Uedit / Jenkins2.LZH / InUse.nameFile < prev    next >
Text File  |  1991-04-08  |  7KB  |  190 lines

  1. ======= InUse.nameFile ===============================
  2.  
  3. COPYRIGHT 1991
  4. Robert A. Jenkins, Ph.D.
  5. 22901 Shagbark Lane
  6. Miller Woods, IL 60411
  7. (708) 758-0344
  8. All Rights Reserved
  9. Rick Stiles may distribute it as he pleases.
  10.  
  11. =============================================================================
  12. While writing a whole new set of commands for a wordprocessor I found myself
  13. with difficulties in keeping track of the keys that I had used and the files
  14. in which I had used them.  I finally decided that it would be a good idea to
  15. take the time to write commands to list the commands automatically.  It is so
  16. much easier to do good work when the drudgery is taken care of by the
  17. computer....
  18. =============================================================================
  19.  
  20. List commands in curFile
  21. <shftAltCtl-l:
  22.    putMsg("Scanning, please wait....")
  23.    equateNum(n0,curFile)
  24.    getFileName(buf54,curFile)
  25.    setSearch(":$/")
  26.    moveCursor(buf54,eFile)
  27.    if (search(buf54,sHilite,eHilite,-1)) {
  28.       equateLoc(buf54,sHilite,sFile)
  29.       clearRgn(buf54,hilite) }
  30.    moveCursor(buf[n0],sFile)
  31.    setSearch("<")
  32.    while (search(buf[n0],sHilite,eHilite,1)) {
  33.       moveCursor(buf[n0],sHilite)
  34.       if (!is(buf[n0],sLine)) goto label(0)                      ..skip this <
  35.       incLoc(buf[n0],sHilite)
  36.       moveCursor(buf[n0],eHilite)
  37.       while (!is(buf[n0],":")) {
  38.          moveCursor(buf[n0],eChar)
  39.          if (is(buf[n0],">")) goto label(0)                  ..skip if default
  40.          if (is(buf[n0]," ")) goto label(0)            ..skip if illegal space
  41.          if (is(buf[n0],eLine)) goto label(0) }        ..skip if no matching :
  42.       equateLoc(buf[n0],eHilite,atCursor)
  43.       ..clean, except it picks up <RAM:uejunk> in config!
  44.       ..alertUser("Found KeyName")..debug
  45.       insertRgn(buf41,eFile,buf[n0],hilite)
  46.       ..add fileName
  47.       moveCursor(buf41,eFile)
  48.       locToCol(buf41,n54,atCursor)
  49.       while (gtNum(25,n54)) {
  50.          insertChar(buf41," ")
  51.          locToCol(buf41,n54,atCursor) }
  52.       insertRgn(buf41,eFile,buf54,all)
  53.       ..add page#:line#
  54.       insertChar(buf41," ")
  55.       getPageRowCol(n54,n55,n56) ..of name in curFile
  56.       toWord(buf41,n54)
  57.       insertChar(buf41,":")
  58.       toWord(buf41,n55)
  59.       insertChar(buf41,eLine)
  60.       LABEL(0) }
  61.    nameBuffer(buf41,"RAD:commandList")
  62.    putMsg("Done")
  63.    >Friday 22-Feb-91 20:31:38
  64.  
  65. Pad page # and line # for correct sorting
  66. <shftAltCtl-k:
  67.    ..pad page# and line# to three digits
  68.    ..first, pad "config!" to "config! "
  69.    moveCursor(curFile,sFile)
  70.    setSearch("config! ")
  71.    while (search(curFile,sHilite,eHilite,1)) {
  72.       moveCursor(curFile,eHilite)
  73.       insertChar(curFile," ") }
  74.    moveCursor(curFile,sFile)
  75.    setSearch(":")
  76.    while (search(curFile,sHilite,eHilite,1)) {
  77.       getPageRowCol(n51,n52,n53)
  78.       if (gtNum(37,n53)) { ..pad page#
  79.          while (!is(curFile,whitespace)) moveCursor(curFile,sChar)
  80.          moveCursor(curFile,eChar)
  81.          sub(n50,37,n53)
  82.          ..putMsg(n50) alertUser("ready to pad page#")
  83.          do (n51,1,n50) insertChar(curFile,"0") }
  84.       moveCursor(curFile,eLine)
  85.       getPageRowCol(n51,n52,n53)
  86.       if (gtNum(41,n53)) { ..pad line#
  87.          while (!is(curFile,":")) moveCursor(curFile,sChar)
  88.          moveCursor(curFile,eChar)
  89.          sub(n50,41,n53)
  90.          ..putMsg(n50) alertUser("ready to pad line#")
  91.          do (n51,1,n50) insertChar(curFile,"0") } }
  92.    putMsg("Done")
  93.    refreshDisplay
  94.    >Friday 22-Feb-91 21:33:56
  95.  
  96. List commands in given directory
  97. <shftAltCtl-m:
  98.    putMsg("Input dirpath containing config!? files:")
  99.    inputString(buf57)  ..show last one
  100.    freeBuf(buf55)
  101.    insertRgn(buf55,sFile,buf57,all)
  102.    insertRgn(buf55,sFile,"LIST ",all)
  103.    insertRgn(buf55,eFile," QUICK ",all)
  104.    freeBuf(buf42)
  105.    execute (buf42,buf55)
  106.    editBuf(buf42)
  107.    ..delete everything except config!? files from list
  108.    freeBuf(buf41)
  109.    while (nothing) {
  110.       if (is(curFile,eFile)) goto label(0)
  111.       if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  112.       equateLoc(curFile,sHilite,atCursor)
  113.       do (n0,1,7) moveCursor(curFile,eChar)
  114.       equateLoc(curFile,eHilite,atCursor)
  115.       freeBuf(buf43)
  116.       insertRgn(buf43,sFile,curFile,hilite)
  117.       setSearch("config!")
  118.       ..alertUser("checking for config!")
  119.       if (!search(buf43,sHilite,eHilite,-1)) {
  120.             moveCursor(curFile,eLine)
  121.             moveCursor(curFile,eChar)
  122.             equateLoc(curFile,eHilite,atCursor)
  123.             clearRgn(curFile,hilite) }
  124.          else
  125.             if (!moveCursor(curFile,downLine)) goto label(0) }          ..exit
  126.    LABEL(0)
  127.    runKey(alt-2)  ..del trailing white
  128.    runKey(normal-bs) ..delete EOL on last line
  129.    moveCursor(curFile,sFile)
  130.    if (!askYesNo("List commands in these config! files?")) return
  131.    while (nothing) {
  132.       ..get a file name
  133.       equateLoc(buf42,sHilite,atCursor)
  134.       moveCursor(buf42,eLine)
  135.       equateLoc(buf42,eHilite,atCursor)
  136.       ..alertUser("got name of file")..debug
  137.       ..create pathname
  138.       freeBuf(buf55)
  139.       insertRgn(buf55,sFile,buf57,all)
  140.       if (!is(buf55,":")) insertChar(buf55,"/")
  141.       insertRgn(buf55,eFile,buf42,hilite)
  142.       loadFile(buf55)
  143.       equateNum(n1,curFile) ..record buf# to delete later
  144.       runKey(shftAltCtl-l)  ..list this file
  145.       ..alertUser("current list")..debug
  146.       freeBuf(buf[n1])
  147.       if (!moveCursor(buf42,downLine)) goto label(1)                  ..exit
  148.       moveCursor(buf42,sLine) }
  149.    LABEL(1)
  150.    editBuf(buf41)
  151.    putMsg("Command list, padding page# and line#, please wait....")
  152.    runKey(shftAltCtl-k)
  153.    putMsg("Sorting, please wait....")
  154.    runKey(shftAlt-s)  ..sort
  155.    
  156.    putMsg("Scanning for duplicates")
  157.    moveCursor(buf41,sFile)
  158.    LABEL(2)
  159.    ..pick up a name
  160.    if (!is(buf41,sLine)) moveCursor(buf41,sLine)
  161.    equateLoc(buf41,sHilite,atCursor)
  162.    do (n0,1,24) moveCursor(buf41,eChar)
  163.    equateLoc(buf41,eHilite,atCursor)
  164.    freeBuf(buf55)
  165.    insertRgn(buf55,sFile,buf41,hilite)
  166.    ..alertUser("first name")..debug
  167.    moveCursor(buf41,eLine) moveCursor(curFile,downLine)
  168.    ..alertUser("next line")..debug
  169.    if (is(buf41,eFile)) {
  170.       putMsg("Done")
  171.       returnTrue }
  172.    moveCursor(buf41,sLine)
  173.    ..pick up next name
  174.    equateLoc(buf41,sHilite,atCursor)
  175.    do (n0,1,24) moveCursor(buf41,eChar)
  176.    equateLoc(buf41,eHilite,atCursor)
  177.    freeBuf(buf56)
  178.    insertRgn(buf56,sFile,buf41,hilite)
  179.    ..alertUser("checking this one")..debug
  180.    setSearch(buf56)
  181.    if (search(buf55,sHilite,eHilite,-1)) {
  182.       vScroll(atCursor)
  183.       if (askYesNo("DUPLICATE of line above, look for more?")) 
  184.             goto label(2)
  185.          else {
  186.             putMsg(" ")
  187.             return } }
  188.    goto label(2)
  189.    >Friday 22-Feb-91 22:24:57
  190.