home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / wp_dtp / uedit25d.lzh / config!m < prev    next >
Text File  |  1989-11-17  |  60KB  |  2,130 lines

  1. ======= MISCELLANEOUS CMDS =======
  2.  
  3. Set max number of files can load for normal editing (1-100, usually 20)
  4. <altCtl-f1:
  5.     putMsg("Input max # documents allowed (1-100)")
  6.     if (inputNum(n54)) setMaxFiles(n54) >
  7.  
  8. Set start of hilite region
  9. <shft-buttonDown:
  10.     equateLoc(curFile,sHilite,mouseLoc) refreshDisplay >
  11.  
  12. Set end of hilite region
  13. <alt-buttonDown:
  14.     equateLoc(curFile,eHilite,mouseLoc) refreshDisplay >
  15.  
  16. Mark region clicked with mouse
  17. <virtual-buttonDown:
  18.     equateLoc(curFile,atCursor,mouseLoc)
  19.     equateLoc(curFile,eInvert,atCursor)
  20.     equateLoc(curFile,sInvert,atCursor)
  21.     if (eqNum(curFile,38)) equateLoc(buf38,eHilite,sHilite)
  22.     while (mouseDown) inputKey(n54)
  23.  
  24.     if (is(curFile,eFile) | is(curFile,whiteSpace)) returnFalse
  25.  
  26.     while (!is(curFile,whiteSpace) & !is(curFile,sFile))
  27.         moveCursor(curFile,sChar)                      .. find start non-white
  28.     if (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
  29.     equateLoc(curFile,sInvert,atCursor)          .. sinvert = start non-white
  30.  
  31.     while (!is(curFile,whiteSpace) & !is(curFile,eFile))
  32.         moveCursor(curFile,eChar)                        .. find end non-white
  33.     equateLoc(curFile,eInvert,atCursor)            .. einvert = end non-white
  34.     if (eqNum(curFile,38)) {                        .. in directory buffer 38
  35.         equateLoc(curFile,sHilite,sInvert)
  36.         equateLoc(curFile,eHilite,eInvert)
  37.         equateLoc(curFile,sInvert,eInvert)
  38.         moveCursor(curFile,sHilite)
  39.     }
  40.     refreshDisplay
  41. >
  42.  
  43. Load File or select Directory that is CTRL-clicked.
  44. <ctl-buttonDown:
  45.     equateNum(n7,curFile)
  46.     if (!runKey(virtual-buttonDown)) { runKey(virtual-buttonUp) return }
  47.     if (!eqNum(curFile,38)) {
  48.         if (geLoc(curFile,sInvert,eInvert)) return                  .. no rgn
  49.         moveCursor(curFile,sChar)
  50.         if (!is(curFile,"/") & !is(curFile,":")) {
  51.             freeBuf(buf54)
  52.             moveCursor(curFile,sInvert)
  53.             while (!eqLoc(curFile,atCursor,eInvert)) {
  54.                 if (is(curFile,":")) goto label(99)
  55.                 moveCursor(curFile,eChar)
  56.             }
  57.             insertRgn(buf54,sFile,buf38,hilite)
  58. label(99)
  59.             insertRgn(buf54,eFile,curFile,invert)
  60.             loadFile(buf54)
  61.             return
  62.         }
  63.         moveCursor(curFile,eInvert)
  64.         freeBuf(buf53)
  65.         insertRgn(buf53,eFile,curFile,invert)
  66.         runKey(virtual-7)                                  .. add dir to buf38
  67.     }
  68.     runKey(virtual-9)                                          .. show dir msg
  69.     return
  70. >
  71.  
  72. Handle buf38 directory traffic
  73. <virtual-buttonUp:
  74.     runKey(virtual-8)                     .. load in dir defalts if not loaded
  75.     equateLoc(buf38,mouseLoc,atCursor)
  76.     equateNum(n8,0)
  77.     if (!eqNum(curFile,38) & !gotoSplit(buf38)) {
  78.         if (!splitWindow(buf38,7)) {
  79.             putMsg("Close a split window so can let you select Directory")
  80.             return
  81.         }
  82.         equateNum(n8,1)                           .. had to make split window
  83.     }
  84.     updateDisplay
  85. label(98)
  86.     equateLoc(buf38,mouseLoc,sFile)
  87.     putMsg(
  88.     "Ctrl-mouse=SelectDir.  F1=Edit.  F2=DirList.  F3=Save.  F4=ChgDir.  F5=CD.")
  89.  
  90.     while (mouseDown) inputKey(n54)
  91.     getKeyVal(macroNum,inputChar)
  92.     switch(macroNum) {
  93.         case(normal-buttonDown) {                    .. done bring down window
  94.             gotoSplit(buf[n7])
  95.             if (eqNum(n8,1)) splitWindow(buf38,0)       .. close it if made it
  96.             runKey(virtual-9)
  97.             return
  98.         }
  99.         case(normal-f1) {                                        .. edit buf38
  100.             putMsg("Press left-Amiga-0 to elim split window.")
  101.             return
  102.         }
  103.         case(ctl-buttonDown) {
  104.             runkey(virtual-buttonDown)
  105.             refreshDisplay
  106.             runKey(virtual-9)
  107.             delay(3)
  108.         }
  109.         case(normal-f2) {                                      .. get dir list
  110.             gotoSplit(buf[n7])
  111.             if (eqNum(n8,1)) splitWindow(buf38,0)       .. close it if made it
  112.             if (newFile) {
  113.                 setFileName(curFile,"DirList")
  114.                 clearRgn(curFile,all)
  115.                 insertRgn(curFile,atCursor,buf38,hilite)
  116.                 insertChar(curFile,eLine)
  117.                 equateLoc(curFile,sPage,sFile)
  118.                 updateDisplay
  119.                 freeBuf(buf54)
  120.                 insertRgn(buf54,eFile,"dir ",all)
  121.                 insertRgn(buf54,eFile,buf38,hilite)
  122.                 execute(curFile,buf54)
  123.  
  124.                                                           .. massage dir list
  125.                 getSearch(buf49)
  126.                 setSearch(" (dir)")
  127.                 moveCursor(curFile,sFile)
  128.                 while (search(curFile,locA,locB,1)) {
  129.                     clearRgn(curFile,loc)
  130.                     insertChar(curFile,"/")
  131.                     moveCursor(curFile,sLine)
  132.                     moveCursor(curFile,eWord)
  133.                     moveCursor(curFile,sWord)
  134.                     insertRgn(curFile,atCursor,buf38,hilite)
  135.                 }
  136.                 setSearch(buf49)                     .. restore search string
  137.                 moveCursor(curFile,sFile)
  138.                 flipFlag(curFile,changed)
  139.                 putMsg("Ctl-click dirnames to add, filenames to load.")
  140.                 return
  141.             } else putMsg("Can't open file buf for dir list")
  142.         }
  143.         case(normal-f3) { saveFile(buf38) }
  144.         case(normal-f4) {                                        .. change dir
  145.             if (gtLoc(buf38,eHilite,sHilite)) {
  146.                 freeBuf(buf54)
  147.                 insertRgn(buf54,eFile,buf38,hilite)
  148.                 changeDir(buf54)
  149.                 goto label(0)
  150.             }
  151.         }
  152.         case(normal-f5) {                                            .. get CD
  153. label(0)    freeBuf(buf53)
  154.             execute(buf53,"CD")
  155.             freeBuf(buf54)
  156.             insertRgn(buf54,eFile,"CD = ",all)
  157.             insertRgn(buf54,eFile,buf53,line)
  158.             putMsg(buf54)
  159.             delay(5)
  160.         }
  161.     }
  162.     goto label(98)
  163. >
  164.  
  165. Click or drag mouse, put word/phrase into index in buf41.  (Ctl-w to see.)
  166. <shftAlt-buttonDown:
  167.     equateLoc(curFile,atCursor,mouseLoc)
  168.     moveCursor(curFile,eWord)
  169.     equateLoc(curFile,eInvert,atCursor)
  170.     moveCursor(curFile,sWord)
  171.     equateLoc(curFile,sInvert,atCursor)
  172.     refreshDisplay >
  173.  
  174. Click or drag mouse, put word/phrase into index in buf41.  (Ctl-w to see.)
  175. <shftAlt-buttonUp:
  176.     equateLoc(curFile,atCursor,mouseLoc)
  177.     moveCursor(curFile,eWord)
  178.     equateLoc(curFile,eInvert,atCursor)
  179.     if (geLoc(curFile,sInvert,eInvert)) returnFalse
  180.     moveCursor(curFile,sInvert)
  181.     if (is(curFile,upperCase)) equateNum(n0,1)
  182.     else equateNum(n0,0)
  183.     toLower(curFile)
  184.     copyChar(curFile,n54)
  185.     if (eqNum(n0,1)) toUpper(curFile)
  186.     if (isEmpty(buf41)) insertChar(buf41,eLine)
  187.     moveCursor(buf41,sFile)
  188.     equateLoc(buf41,sPage,atCursor)
  189. label(1)
  190.     if (is(buf41,upperCase)) equateNum(n0,1)
  191.     else equateNum(n0,0)
  192.     toLower(buf41)
  193.     copyChar(buf41,n53)
  194.     if (eqNum(n0,1)) toUpper(buf41)
  195.     if (gtNum(n54,n53)) {
  196.         moveCursor(buf41,downLine)
  197.         if (!is(buf41,eFile)) goto label(1)
  198.     }
  199.     insertRgn(buf41,atCursor,curFile,invert)
  200.     insertChar(buf41,eLine)
  201. >
  202.  
  203. Set start of invert region
  204. <shftCtl-buttonDown:
  205.     equateLoc(curFile,sInvert,mouseLoc) refreshDisplay >
  206.  
  207. Set end of invert region
  208. <altCtl-buttonDown:
  209.     equateLoc(curFile,eInvert,mouseLoc) refreshDisplay >
  210.  
  211. Drag mouse and create hilite region
  212. <shftAltCtl-buttonDown:
  213.     equateLoc(curFile,locA,mouseLoc)
  214.     while (trackMouse) nothing
  215.     if (gtLoc(curFile,locA,mouseLoc)) {
  216.         equateLoc(curFile,sHilite,mouseLoc)
  217.         equateLoc(curFile,eHilite,locA)
  218.     } else {
  219.         equateLoc(curFile,eHilite,mouseLoc)
  220.         equateLoc(curFile,sHilite,locA)
  221.     }
  222.     refreshDisplay >
  223.  
  224. Adjust active split window size with mouse
  225. <lAmiga-=:
  226.     getSplitLines(n53,n52)                           .. see if is upper split
  227.     if (eqNum(n53,0)) {
  228.         putMsg("Adjust lower splits, not top one")
  229.         returnFalse                                 .. don't size main window
  230.     }
  231.     putMsg("Press button, move mouse to set split window size")
  232.     getkey(N54)
  233.     if (!mouseDown) return
  234.     trackMouse
  235.     mouseXY(n4,n5)
  236.     equateNum(n54,curFile)
  237. label(0)
  238.     if (inputWaiting) { putMsg(" ") return }
  239.     trackMouse
  240.     mouseXY(n2,n3)
  241.     getSplitLines(n53,n52)                                .. get start & stop
  242.     sub(n52,n52,n53)
  243.     if (gtNum(n5,n3)) {
  244.         if (gtNum(n53,3)) incNum(n52)
  245.         else goto label(0)
  246.     }
  247.     else if (gtNum(n3,n5)) decNum(n52)
  248.     else goto label(0)
  249.     if (!eqNum(n5,n3)) {
  250.         splitWindow(curFile,0)
  251.         if (gtNum(2,n52)) equateNum(n52,2)
  252.         splitWindow(buf[n54],n52)
  253.         updateDisplay
  254.         equateNum(n5,n3)
  255.     }
  256.     goto label(0)
  257.     >
  258.  
  259. Scroll up 1 line
  260. <normal-upArrow:
  261.     if (!thisKey) vScroll(-1)
  262.     else while (nothing) {
  263.         if (!vScroll(-1) | !inputWaiting) return
  264.         while (inputKey(n54)) nothing
  265.         vScroll(-3)
  266.         updateDisplay
  267.     } >
  268.  
  269. Scroll down 1 line
  270. <normal-downArrow:
  271.     if (!thisKey) vScroll(1)
  272.     else while (nothing) {
  273.         if (!vScroll(1) | !inputWaiting) return
  274.         while (inputKey(n54)) nothing
  275.         vScroll(3)
  276.         updateDisplay
  277.     } >
  278.  
  279. Scroll right 1 char
  280. <normal-leftArrow: hScroll(1) >
  281.  
  282. Scroll left 1 char
  283. <normal-rightArrow: hScroll(-1) >
  284.  
  285. Scroll up 11 lines
  286. <shft-upArrow: vScroll(-11) >
  287.  
  288. Scroll down 11 lines
  289. <shft-downArrow: vScroll(11) >
  290.  
  291. Scroll right 10 chars
  292. <shft-leftArrow: hScroll(10) >
  293.  
  294. Scroll left 10 chars
  295. <shft-rightArrow: hScroll(-10) >
  296.  
  297. Scroll to start of page
  298. <alt-upArrow: vScroll(sPage) >
  299.  
  300. Scroll to bottom of page
  301. <alt-downArrow: vScroll(ePage) >
  302.  
  303. Scroll right 20 chars
  304. <alt-leftArrow: hScroll(20) >
  305.  
  306. Scroll left 20 chars
  307. <alt-rightArrow: hScroll(-20) >
  308.  
  309. Scroll to start of file
  310. <ctl-upArrow: vScroll(sFile) >
  311.  
  312. Scroll to end of file
  313. <ctl-downArrow: vScroll(eFile) >
  314.  
  315. Scroll to end of line
  316. <ctl-leftArrow:
  317.     getLocal(curFile,n54,lineLength)
  318.     hScroll(n54) >
  319.  
  320. Scroll to start of line
  321. <ctl-rightArrow: while (hScroll(-1)) nothing >
  322.  
  323. Load and show help file - press again to release help
  324. <normal-help:
  325.     if (!isEmpty(buf42)) {
  326.                    equateNum(n54,curFile)
  327.                    if (eqNum(n54,42)) freeBuf(buf42)
  328.                    else editBuf(buf42)
  329.     } else {
  330.         insertFile(buf42,sFile,"Help!")
  331.         if (isEmpty(buf42)) {
  332.             freeBuf(buf42)
  333.             insertFile(buf42,sFile,"S:Help!")
  334.         }
  335.         if (!isEmpty(buf42)) {
  336.             editBuf(buf42)
  337.             flipFlag(buf42,readOnly)
  338.         } else putMsg("Can't find S:Help! file.")
  339.     } >
  340.  
  341. Show current values of line-length, lines/page, tab-table #, colors, etc
  342. <shft-help:
  343.     putMsg(" ")
  344.     equateLoc(curfile,locA,atCursor)
  345.     moveCursor(curfile,sFile)
  346.     moveCursor(curfile,eLine)
  347.     copyChar(curfile,n52)
  348.     moveCursor(curfile,locA)
  349.     updateDisplay
  350.     equateNum(n51,curFile)
  351.     text(" ",0,0,0,-2)
  352.     text("Serial number:                       Left margin     :",2,0,0,0)
  353.     text("Buffer       :                       Top margin      :",3,0,0,0)
  354.     text("Changed      :                       Bottom margin   :",4,0,0,0)
  355.     text("Size         :                       Tab table       :",5,0,0,0)
  356.     text("Max files    :                       Printer select  :",6,0,0,0)
  357.     text("Split size   :                       (unused)        :",7,0,0,0)
  358.     text("Idle timer   :                       Print tabs      :",8,0,0,0)
  359.     text("Colors       :                       Smart tabs      :",9,0,0,0)
  360.     text("Scroll type  :                       Search wildcard :",10,0,0,0)
  361.     text("Hide display :                       \"\"    multiWild :",11,0,0,0)
  362.     text("End-of-line  :                       \"\"       allBut :",12,0,0,0)
  363.     text("PM terminator:                       \"\"     eitherOr :",13,0,0,0)
  364.     text("Line length  :                       \"\"  singleWhite :",14,0,0,0)
  365.     text("Lines/page   :                       \"\"   multiWhite :",15,0,0,0)
  366.     text("Values for this buffer",1,0,5,0)
  367.     getSerialNum(n54)
  368.     text(n54,2,16,1,0)
  369.     getLocal(curFile,n54,leftMargin)
  370.     text(n54,2,56,1,0)
  371.     text(n51,3,16,1,0)                                        ..buffer number
  372.     getLocal(curFile,n54,topMargin)
  373.     text(n54,3,56,1,0)
  374.     if (getFlag(curFile,changed)) text("YES",4,16,2,0)
  375.     else text("no",4,16,1,0)
  376.     getLocal(curFile,n54,bottomMargin)
  377.     text(n54,4,56,1,0)
  378.     getLocal(curFile,n54,tabTable)    .. SEE BELOW - computing file size last
  379.     text(n54,5,56,1,0)
  380.     getMaxFiles(n54)
  381.     text(n54,6,16,1,0)
  382.     text(prefPrint,6,56,1,0)
  383.     text(splitSize,7,16,1,0)
  384.     text(0,7,56,1,0)
  385.     text(idleTime,8,16,1,0)
  386.     text(printTabs,8,56,1,0)
  387.     freeBuf(buf53)
  388.     getWBColors(n0,n1,n2,n3)
  389.     toWord(buf53,n0)
  390.     toWord(buf53,n1)
  391.     toWord(buf53,n2)
  392.     toWord(buf53,n3)
  393.     text(buf53,9,16,1,0)
  394.     text(smartTabs,9,56,1,0)
  395.     text(scrollType,10,16,1,0)
  396.     freeBuf(buf53)
  397.     insertChar(buf53,wildCard)
  398.     text(buf53,10,56,1,0)
  399.     if (getFlag(curFile,hideDisplay)) text("YES",11,16,2,0)
  400.     else text("no",11,16,1,0)
  401.     freeBuf(buf53)
  402.     insertChar(buf53,multiWild)
  403.     text(buf53,11,56,1,0)
  404.     text(n52,12,16,1,0)                               .. eol, copied it above
  405.     freeBuf(buf53)
  406.     insertChar(buf53,allBut)
  407.     text(buf53,12,56,1,0)
  408.     text(pmESC,13,16,1,0)
  409.     freeBuf(buf53)
  410.     insertChar(buf53,eitherOr)
  411.     text(buf53,13,56,1,0)
  412.     getLocal(curFile,n54,lineLength)
  413.     text(n54,14,16,1,0)
  414.     text(singleWhite,14,56,1,0)
  415.     getLocal(curFile,n54,pageLines)
  416.     text(n54,15,16,1,0)
  417.     text(multiWhite,15,56,1,0)
  418.     putMsg("Any key to continue")
  419.     fileSize(curFile,n54)
  420.     text(n54,5,16,1,0)
  421.     getKey(n54)
  422.     putMsg(" ")
  423.     refreshDisplay >
  424.  
  425. Rotate 4 Workbench colors in Uedit
  426. <alt-help: toggle(color) >
  427.  
  428. Start this Key-Help mode - press Amiga-ESC to leave this Key-Help mode
  429. <ctl-help: flipFlag(curFile,teachKeys) >
  430.  
  431. Refresh window (or screen in interlace), including title bar
  432. <shftCtl-help: refreshDisplay >
  433.  
  434. Rebuild the menus by running the startup command
  435. <shftAltCtl-Help: runKey(startup) >
  436.  
  437. Close file.  If changed, ask "Save changes?"  If no files, ask "Really quit?"
  438. <normal-closeBox:
  439.     if (getFlag(curfile,changed) &
  440.         askYesNo("Save changes?") &
  441.             !saveFile(curFile)) return
  442.     freeBuf(curFile)
  443.     if (isEmpty(curFile)) {
  444.         equateNum(n1,0)
  445.         getMaxFiles(n2)
  446.         decNum(n2)
  447.         do (n0,0,n2) if (!isEmpty(buf[n0])) equatenum(n1,1)
  448.         if (eqNum(n1,0) & askYesNo("Really quit?")) quit(0)
  449.     } >
  450.  
  451. Switch to next document
  452. <normal-gadget1: toggle(curFile) >
  453.  
  454. Switch to previous document
  455. <normal-gadget2: runKey(shft-f1) >
  456.  
  457. Scroll display down
  458. <normal-gadget3: while (mouseDown) { vScroll(downLine) updateDisplay } >
  459.  
  460. Scroll display up
  461. <normal-gadget4: while (mouseDown) { vScroll(upLine)   updateDisplay } >
  462.  
  463. Switch to next file
  464. <normal-f1: toggle(curFile) >
  465.  
  466. Switch to previous file
  467. <shft-f1:
  468.     getMaxFiles(n53)
  469.     if (geNum(1,n53)) { editBuf(buf0) returnFalse }
  470.     decNum(n53)
  471.     equateNum(n54,curFile)
  472.     while (nothing) {
  473.         if (gtNum(n54,n53)) equateNum(n54,n53)
  474.         decNum(n54)
  475.         if (gtNum(0,n54)) equateNum(n54,n53)
  476.         if (getFileName(buf54,buf[n54])) {
  477.             editBuf(buf[n54])
  478.             returnTrue
  479.         }
  480.     } >
  481.  
  482. Load a file
  483. <alt-f1:
  484.     putMsg("Input new filename:")
  485.     freeBuf(buf43)
  486.     if (inputString(buf43)) loadFile(buf43) >
  487.  
  488. Open new "Noname" file
  489. <ctl-f1: newFile >
  490.  
  491. Insert file at cursor
  492. <shftAlt-f1:
  493.     putMsg("Input filename to insert:")
  494.     freeBuf(buf43)
  495.     if (inputString(buf43)) insertFile(curFile,atCursor,buf43) >
  496.  
  497. Restore current file to original
  498. <shftCtl-f1:
  499.     if (!askYesNo("Restore file to original?")) returnFalse
  500.     if (getFileName(buf43,curFile)) { freeBuf(curFile) loadFile(buf43) } >
  501.  
  502. Bring up file-requester
  503. <lAmiga-f1:
  504.     freeBuf(buf54)
  505.     insertRgn(buf54,eFile,buf38,hilite)
  506.     moveCursor(buf54,efile)
  507.     moveCursor(buf54,sChar)
  508.     if (!is(buf54,sfile) & is(buf54,"/")) clearChar(buf54)
  509.     if (fileRequest(buf54,"Select Directory and/or File")) {
  510.         freeBuf(buf53)                         .. if True, always has 2 lines
  511.         insertRgn(buf53,efile,buf54,all)
  512.         moveCursor(buf53,sfile)
  513.         if (!is(buf53,eline)) moveCursor(buf53,eLine)
  514.         clearChar(buf53)                                     .. erase the eol
  515.         loadFile(buf53)
  516.     }
  517.     if (isEmpty(buf54)) {
  518.         putMsg("No selection or no Arp")
  519.         returnFalse
  520.     }
  521.     moveCursor(buf54,sfile)    .. puts filename on line 2.  outputs "*" if no
  522.     if (!is(buf54,"*") & !is(buf54,eLine)) {
  523.         freeBuf(buf53)
  524.         insertRgn(buf53,efile,buf54,line)
  525.         runKey(virtual-7)      .. store dirname in buf38, if not already there
  526.     }
  527. >
  528.  
  529. Save file currently in window
  530. <normal-f2: saveFile(curFile) >
  531.  
  532. Save file under different name
  533. <shft-f2:
  534.     putMsg("Save file as:")
  535.     freeBuf(buf43)
  536.     if (inputString(buf43) & setFileName(curFile,buf43)) saveFile(curFile) >
  537.  
  538. Save all changed files
  539. <alt-f2:
  540.     getMaxFiles(n53)
  541.     decNum(n53)
  542.     do(n54,0,n53) if (getFlag(buf[n54],changed)) saveFile(buf[n54]) >
  543.  
  544. Turn on/off saving changes during idle periods
  545. <ctl-f2: flipFlag(curFile,userLocalA)>
  546.  
  547. Abort the current file save
  548. <shftAlt-f2: abortSave >
  549.  
  550. Save hilite as...
  551. <shftCtl-f2:
  552.     freeBuf(buf43)
  553.     insertRgn(buf43,atCursor,buf38,hilite)
  554.     putMsg("Save hilite as:")
  555.     if (!inputString(buf43)) return
  556.     freeBuf(buf54)
  557.     insertRgn(buf54,efile,curFile,hilite)
  558.     setFileName(buf54,buf43)
  559.     saveFile(buf54)
  560.     freeBuf(buf54) >
  561.  
  562. Close current file.  If changed, ask "Save changes?"
  563. <normal-f3:
  564.     if (!isEmpty(curFile)
  565.         & getFlag(curFile,changed)
  566.         & askYesNo("Save changes before closing?")
  567.         & !saveFile(curFile)) returnFalse
  568.     freeBuf(curFile) >
  569.  
  570. Save file, if changed, then close it
  571. <shft-f3:
  572.     if (getFlag(curFile,changed) & !saveFile(curFile)) returnFalse
  573.     freeBuf(curFile) >
  574.  
  575. Free all non-file buffers.  Erases search buffer, directory name, etc
  576. <alt-f3:
  577.     getMaxFiles(n52)
  578.     do(n54,n52,54) freeBuf(buf[n54]) >
  579.  
  580. Ask "Save changes?", if any changes, then ask "Really quit?"
  581. <normal-f4:
  582.     if (!askYesNo("Really quit?")) returnFalse
  583.     equateNum(n53,0)
  584.     getMaxFiles(n52)
  585.     decNum(n52)
  586.     do(n54,0,n52) if (getFlag(buf[n54],changed)) equateNum(n53,1)
  587.     if (eqNum(n53,1) & askYesNo("Save changes?") & !runKey(shft-f4))
  588.         returnFALSE
  589.     quit(0) >
  590.  
  591. Save all changed files automatically, then quit
  592. <shft-f4:
  593.     getMaxFiles(n52)
  594.     decNum(n52)
  595.     do (n54,0,n52)
  596.     if (getFlag(buf[n54],changed) & !saveFile(buf[n54])) returnFalse
  597.     quit(0) >
  598.  
  599. Swap next 2 commands. (Mouse buttons, menu selections, gadgets, keys.)
  600. <normal-f5:
  601.     putMsg("Next 2 function keys will be swapped!")
  602.     if (getKey(n53) & getKey(n54) & swapKey(n53,n54))
  603.             { putMsg("Keys were swapped.") return }
  604.     putMsg(" ") >
  605.  
  606. Toggle overstrike typing mode
  607. <shft-f5: flipFlag(curFile,overstrike) >
  608.  
  609. Toggle autoindent typing mode
  610. <alt-f5: flipFlag(curFile,autoIndent) >
  611.  
  612. Toggle wordwrap typing mode
  613. <ctl-f5: flipFlag(curFile,wordWrap) >
  614.  
  615. Toggle "changed" status of current buffer
  616. <lAmiga-f5: flipFlag(curFile,changed) >
  617.  
  618. Convert file to read-only status
  619. <shftAlt-f5: flipFlag(curFile,readOnly) >
  620.  
  621. Toggle speak-messages status
  622. <shftCtl-f5: flipFlag(curFile,speakMsgs) >
  623.  
  624. Toggle speak-alerts status
  625. <altCtl-f5: flipFlag(curFile,speakAlerts) >
  626.  
  627. Toggle auto-backup mode
  628. <shftAltCtl-f5: flipFlag(curFile,autoBackup) >
  629.  
  630. Select buffer 44 to use for scratch editing or writing commands
  631. <shft-f6:
  632.     editBuf(buf44)
  633.     putMsg("Type in command, <anykey: etc>, and press F6 to compile:") >
  634.  
  635. Save UE config to disk.  Default is Data! or last name you gave
  636. <alt-f6:
  637.     if (askYesNo("Save data?")) {
  638.         putMsg("Input data filename or pmESC:")
  639.         freeBuf(buf54)
  640.         inputString(buf54)
  641.         saveConfig(buf54)
  642.     } >
  643.  
  644. Restore UE config from disk.  Default is Data! or last name you gave
  645. <ctl-f6:
  646.     if (askYesNo("Load data?")) {
  647.         putMsg("Input data filename or pmESC:")
  648.         freeBuf(buf54)
  649.         inputString(buf54)
  650.         loadConfig(buf54)
  651.     } >
  652.  
  653. Compile configuration default values at the top of Config! file
  654. <altCtl-f6:
  655.     moveCursor(curFile,sFile)
  656.     if (!compileDefaults) beepDisplay>
  657.  
  658. Input the number of a buffer to edit
  659. <shftAlt-f6:
  660.     putMsg("Input number of buffer to edit:")
  661.     if (inputNum(n54)) { editBuf(buf[n54]) vScroll(sFile) } >
  662.  
  663. Examine all buffers that aren't empty
  664. <shftCtl-f6:
  665.     getMaxFiles(n52)
  666.     do (n54,n52,99) if (!isEmpty(buf[n54])) {
  667.         editBuf(buf[n54])
  668.         vScroll(sFile)
  669.         updateDisplay
  670.         putMsg("F1=continue, F2=edit this one, F3=stop:")
  671.         getKey(n53)
  672.         if (eqNum(n53,normal-f2)) { putMsg(" ") return }
  673.         if (eqNum(n53,normal-f3)) goto label(1)
  674.     }
  675.     label(1)
  676.     toggle(curFile)
  677.     putMsg(" ") >
  678.  
  679. Kill next command, including mouse button, menu selection, gadget, key
  680. <shftAltCtl-f6:
  681.     putMsg("Next command-key will be deleted!")
  682.     if (getKey(n54) & killKey(n54))
  683.             { putMsg("Key command was deleted.") return }
  684.     putMsg(" ") >
  685.  
  686.  
  687. Find out if keys have got commands attached
  688. <lAmiga-f6:
  689.     putMsg("Press any key")
  690.     while (getKey(n54)) {
  691.         if (inUse(n54)) putMsg("In use - Amiga-esc=abort")
  692.         else putMsg("Available - Amiga-esc=abort")
  693.     }>
  694.  
  695. Push current buffer onto buffer stack
  696. <lAmiga-w: push(curFile) runKey(virtual-w)  >
  697.  
  698. Pop buffer stack
  699. <rAmiga-w:
  700.     getStackSize(n51,n52,n53)
  701.     if (geNum(0,n51)) {
  702.         putMsg("Buffer stack is empty")
  703.         returnFalse
  704.     }
  705.     if (!askYesNo("Replace current buffer, deleting old?") & !newFile) {
  706.         putMsg("Can't open a file buffer")
  707.         returnFalse
  708.     }
  709.     pop(curFile)
  710.     runKey(virtual-w) >
  711.  
  712. Rotate buffer stack
  713. <shftAlt-w: rollStack(curFile,1) runKey(virtual-w) >
  714.  
  715. Show number of buffers in stack
  716. <virtual-w:
  717.     getStackSize(n51,n52,n53)
  718.     freeBuf(buf54)
  719.     insertRgn(buf54,atCursor,"Buffers on stack: ",all)
  720.     toWord(buf54,n51)
  721.     putMsg(buf54)  >
  722.  
  723. Input search text & search fwd.  (Either-Or="$", wildcards= "?" & "*".)
  724. <normal-f7: freeBuf(buf49) runKey(shft-f7) >
  725.  
  726. Modify existing search text and then search fwd
  727. <shft-f7:
  728.     putMsg("Input search string:")
  729.     inputString(buf49)
  730.     setSearch(buf49)
  731.     runKey(normal-f9) >
  732.  
  733. Input new search wild-card characters
  734. <alt-f7:
  735.     putMsg("Input single wild-card char:")
  736.     getChar(wildCard)
  737.     putMsg("Input multi wild-card char:")
  738.     getChar(multiWild)
  739.     putMsg("White on single wildcards: 0=no, 1=space/tab, 2=all white:")
  740.     getChar(n54)
  741.     if (geNum(n54,"0") & geNum("2",n54)) sub(singleWhite,n54,"0")
  742.     putMsg("White on multi wildcards: 0=no, 1=space/tab, 2=all white:")
  743.     getChar(n54)
  744.     if (geNum(n54,"0") & geNum("2",n54)) sub(multiWhite,n54,"0")
  745.     putMsg("Input all-but delimiter char:")
  746.     getChar(allBut)
  747.     putMsg(" ")>
  748.  
  749. Input new search either-or character
  750. <ctl-f7:
  751.     putMsg("Input new search either-or char:")
  752.     getChar(eitherOr)
  753.     putMsg(" ")>
  754.  
  755. Input replace text to use in search-replace
  756. <normal-f8: freeBuf(buf48) runKey(shft-f8) >
  757.  
  758. Modify existing replace text
  759. <shft-f8: putMsg("input replace string:") inputString(buf48) >
  760.  
  761. Search forward, mark matched region, put cursor at start of rgn
  762. <normal-f9:
  763.     if (eqLoc(curFile,atCursor,eInvert)) moveCursor(curFile,sChar)
  764.     if (search(curFile,sInvert,eInvert,1)) {
  765.       putMsg(" ")
  766.       return
  767.     }
  768.     runKey(virtual-f9) >                                 .. failed search msg
  769.  
  770. Search backward, mark matched region, put cursor at start of rgn
  771. <shft-f9:
  772.     if (search(curFile,sInvert,eInvert,-1)) { putMsg(" ") return }
  773.     runKey(virtual-f9) >                                 .. failed search msg
  774.  
  775. Failed search message used by fwd/bkwd search.
  776. <virtual-f9:
  777.     putMsg("Search failed.")
  778.     equateLoc(curFile,sInvert,eInvert)
  779.     refreshDisplay
  780.     returnFalse >
  781.  
  782. Replace matched region with replace text, then search forward
  783. <normal-f10:
  784.     if (eqLoc(curFile,sInvert,eInvert)) returnFalse
  785.     clearRgn(curFile,invert)
  786.     insertRgn(curFile,sInvert,buf48,all)
  787.     runKey(normal-f9) >
  788.  
  789. Replace matched region with replace text, then search backward
  790. <shft-f10:
  791.     if (eqLoc(curFile,sInvert,eInvert)) returnFalse
  792.     clearRgn(curFile,invert)
  793.     insertRgn(curFile,sInvert,buf48,all)
  794.     runKey(shft-f9) >
  795.  
  796. Replace and continue forward search-replace until search fails
  797. <alt-f10: while(runKey(normal-f10)) nothing >
  798.  
  799. Open a space under cursor for typing
  800. <shft-del:
  801.     insertChar(curFile," ") moveCursor(curFile,sChar)
  802.     if (is(curFile,sLine)) refreshDisplay>
  803.  
  804. Open line for typing below cursor line
  805. <alt-del:
  806.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  807.     insertChar(curFile,eLine)>
  808.  
  809. Delete line above cursor line
  810. <ctl-del:
  811.     equateLoc(curFile,mouseLoc,atCursor)
  812.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  813.     if (!is(curFile,sFile)) {
  814.         moveCursor(curFile,upLine)
  815.         runKey(virtual-x)                                   .. this runs ctl-d
  816.         moveCursor(curFile,mouseLoc)
  817.     }>
  818.  
  819. Open a space for typing in front of current word
  820. <shft-bs:
  821.     if (!is(curFile,sWord)) moveCursor(curFile,sWord)
  822.     runKey(shft-del)>
  823.  
  824. Open line for typing above the current line
  825. <alt-bs:
  826.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  827.     insertChar(curFile,eLine)  moveCursor(curFile,sChar)>
  828.  
  829. Delete line below cursor line
  830. <ctl-bs:
  831.     equateLoc(curFile,mouseLoc,atCursor)
  832.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  833.     if (!is(curFile,eFile)) {
  834.         moveCursor(curFile,downLine)
  835.         runKey(virtual-x)                                   .. this runs ctl-d
  836.         moveCursor(curFile,mouseLoc)
  837.     }>
  838.  
  839.                             *** Keypad Keys ***
  840. Find cursor and center it in window
  841. <normal-kp5: vScroll(atCursor) >
  842.  
  843. Delete word left, storing it in Undo buffer
  844. <normal-kp7:
  845.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  846.     equateLoc(curFile,locB,atCursor)
  847.     moveCursor(curFile,sWord)
  848.     equateLoc(curFile,locA,atCursor)
  849.     insertRgn(buf45,sFile,curFile,loc)
  850.     equateLoc(buf45,sPage,sFile)
  851.     clearRgn(curFile,loc) >
  852.  
  853. Delete word right, storing it in Undo buffer
  854. <normal-kp9:
  855.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  856.     equateLoc(curFile,locA,atCursor)
  857.     moveCursor(curFile,eWord)
  858.     equateLoc(curFile,locB,atCursor)
  859.     insertRgn(buf45,eFile,curFile,loc)
  860.     equateLoc(buf45,sPage,sFile)
  861.     clearRgn(curFile,loc) >
  862.  
  863. Move cursor up 1 line
  864. <normal-kp8: moveCursor(curFile,upLine) >
  865.  
  866. Move cursor down 1 line
  867. <normal-kp2: moveCursor(curFile,downLine) >
  868.  
  869. Move cursor to start of word
  870. <normal-kp4: moveCursor(curFile,sWord) >
  871.  
  872. Move cursor to end of word
  873. <normal-kp6: moveCursor(curFile,eWord) >
  874.  
  875. Set start of hilite region at cursor
  876. <normal-kp1: equateLoc(curFile,sHilite,atCursor) refreshDisplay >
  877.  
  878. Set end of hilite region at cursor
  879. <normal-kp3: equateLoc(curFile,eHilite,atCursor) refreshDisplay >
  880.  
  881. UNDO scratch deletes, inserting scratch delete buffer at cursor
  882. <normal-kp0: insertRgn(curFile,atCursor,buf45,all) >
  883.  
  884. Copy hilite region into buffer
  885. <normal-kpDot:
  886.     if (getFlag(curFile,columnar)) { runKey(shftCtl-3) return }
  887.     if (gtLoc(curFile,eHilite,sHilite)) {
  888.         freeBuf(buf47)
  889.         insertRgn(buf47,sFile,curFile,hilite)
  890.         equateLoc(buf47,sPage,sFile)
  891.     } else returnFalse >
  892.  
  893. Copy hilite region into buffer, then delete hilite region
  894. <normal-kpMinus:
  895.     if (getFlag(curFile,columnar)) { runKey(shftCtl-1) return }
  896.     if (runKey(normal-kpDot)) clearRgn(curFile,hilite) >
  897.  
  898. Insert copied hilite at cursor
  899. <normal-kpEnter:
  900.     if (getFlag(curFile,columnar)) { runKey(shftCtl-4) return }
  901.     if (is(curFile,sFile)) {
  902.         equateLoc(curFile,sHilite,atCursor)
  903.         equateLoc(curFile,eHilite,sHilite)
  904.     } else {
  905.         equateLoc(curFile,sHilite,atCursor)
  906.         decLoc(curFile,sHilite)
  907.         equateLoc(curFile,eHilite,atCursor)
  908.     }
  909.     insertRgn(curFile,atCursor,buf47,all)
  910.     if (eqLoc(curFile,atCursor,sHilite)) equateLoc(curFile,sHilite,sFile)
  911.     else incLoc(curFile,sHilite)
  912.     if (!onScreen(atCursor)) vScroll(atCursor) >
  913.  
  914. Find cursor and center it in window
  915. <shft-kp5: vScroll(atCursor) >
  916.  
  917. Delete char to left of cursor, storing it in Undo buffer
  918. <shft-kp7:
  919.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  920.     equateLoc(curFile,locB,atCursor)
  921.     moveCursor(curFile,sChar)
  922.     equateLoc(curFile,locA,atCursor)
  923.     insertRgn(buf45,sFile,curFile,loc)
  924.     equateLoc(buf45,sPage,sFile)
  925.     clearRgn(curFile,loc) >
  926.  
  927. Delete char under cursor, storing it in Undo buffer
  928. <shft-kp9:
  929.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  930.     equateLoc(curFile,locA,atCursor)
  931.     moveCursor(curFile,eChar)
  932.     equateLoc(curFile,locB,atCursor)
  933.     insertRgn(buf45,eFile,curFile,loc)
  934.     equateLoc(buf45,sPage,sFile)
  935.     clearRgn(curFile,loc) >
  936.  
  937. Move cursor up one line
  938. <shft-kp8: moveCursor(curFile,upLine) >
  939.  
  940. Move cursor down one line
  941. <shft-kp2: moveCursor(curFile,downLine) >
  942.  
  943. Move cursor left 1 char
  944. <shft-kp4: moveCursor(curFile,sChar) >
  945.  
  946. Move cursor right 1 char
  947. <shft-kp6: moveCursor(curFile,eChar) >
  948.  
  949. Set start of hilite region at cursor
  950. <shft-kp1: runKey(normal-kp1) >
  951.  
  952. Set end of hilite region at cursor
  953. <shft-kp3: runKey(normal-kp3) >
  954.  
  955. UNDO scratch deletes, inserting scratch delete buffer at cursor
  956. <shft-kp0: runKey(normal-kp0) >
  957.  
  958. Copy hilite region into buffer
  959. <shft-kpDot: runKey(normal-kpDot) >
  960.  
  961. Copy hilite region into buffer, then delete hilite region
  962. <shft-kpMinus: runKey(normal-kpMinus) >
  963.  
  964. Insert copied hilite region at cursor
  965. <shft-kpEnter: runKey(normal-kpEnter) >
  966.  
  967. Find cursor and center it in window
  968. <alt-kp5: vScroll(atCursor) >
  969.  
  970. Delete to start of line, storing it in Undo buffer
  971. <alt-kp7:
  972.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  973.     if (is(curFile,sLine)) runKey(shft-kp7)
  974.     else {
  975.         equateLoc(curFile,locB,atCursor)
  976.         moveCursor(curFile,sLine)
  977.         equateLoc(curFile,locA,atCursor)
  978.         insertRgn(buf45,sFile,curFile,loc)
  979.         equateLoc(buf45,sPage,sFile)
  980.         clearRgn(curFile,loc)
  981.     } >
  982. Delete to end of line, storing it in Undo buffer
  983. <alt-kp9:
  984.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  985.     if (is(curFile,eLine)) runKey(shft-kp9)
  986.     else {
  987.         equateLoc(curFile,locA,atCursor)
  988.         moveCursor(curFile,eLine)
  989.         equateLoc(curFile,locB,atCursor)
  990.         insertRgn(buf45,eFile,curFile,loc)
  991.         equateLoc(buf45,sPage,sFile)
  992.         clearRgn(curFile,loc)
  993.     } >
  994.  
  995. Move cursor to start of page
  996. <alt-kp8: moveCursor(curFile,sPage) vScroll(atCursor)>
  997.  
  998. Move cursor to end of page
  999. <alt-kp2: moveCursor(curFile,ePage) >
  1000.  
  1001. Move cursor to start of line
  1002. <alt-kp4: moveCursor(curFile,sLine) >
  1003.  
  1004. Move cursor to end of line
  1005. <alt-kp6: moveCursor(curFile,eLine) >
  1006.  
  1007. Set start of hilite region at cursor
  1008. <alt-kp1: runKey(normal-kp1) >
  1009.  
  1010. Set end of hilite region at cursor
  1011. <alt-kp3: runKey(normal-kp3) >
  1012.  
  1013. UNDO scratch deletes, inserting scratch delete buffer at cursor
  1014. <alt-kp0: runKey(normal-kp0) >
  1015.  
  1016. Copy hilite region into buffer
  1017. <alt-kpDot: runKey(normal-kpDot) >
  1018.  
  1019. Copy hilite region into buffer, then delete hilite region
  1020. <alt-kpMinus: runKey(normal-kpMinus) >
  1021.  
  1022. Insert copied hilite region at cursor
  1023. <alt-kpEnter: runKey(normal-kpEnter) >
  1024.  
  1025. Find cursor and center it in window
  1026. <ctl-kp5: vScroll(atCursor) >
  1027.  
  1028. Delete from cursor to start of page, storing it in Undo buffer
  1029. <ctl-kp7:
  1030.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  1031.     equateLoc(curFile,locB,atCursor)
  1032.     moveCursor(curFile,sPage)
  1033.     equateLoc(curFile,locA,atCursor)
  1034.     insertRgn(buf45,sFile,curFile,loc)
  1035.     equateLoc(buf45,sPage,sFile)
  1036.     clearRgn(curFile,loc)
  1037.     vScroll(atCursor)
  1038.     updateDisplay >
  1039.  
  1040. Delete from cursor to end of page, storing it in Undo buffer
  1041. <ctl-kp9:
  1042.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  1043.     equateLoc(curFile,locA,atCursor)
  1044.     moveCursor(curFile,ePage)
  1045.     equateLoc(curFile,locB,atCursor)
  1046.     insertRgn(buf45,eFile,curFile,loc)
  1047.     equateLoc(buf45,sPage,sFile)
  1048.     clearRgn(curFile,loc)
  1049.     updateDisplay >
  1050.  
  1051. Move cursor to start of form
  1052. <ctl-kp8: moveCursor(curFile,sForm) >
  1053.  
  1054. Move cursor to end of form
  1055. <ctl-kp2: moveCursor(curFile,eForm) >
  1056.  
  1057. Move cursor to start of line
  1058. <ctl-kp4: moveCursor(curFile,sLine) >
  1059.  
  1060. Move cursor to end of line
  1061. <ctl-kp6: moveCursor(curFile,eLine) >
  1062.  
  1063. Set start of invert region at cursor
  1064. <ctl-kp1: equateLoc(curFile,sInvert,atCursor) refreshDisplay >
  1065.  
  1066. Set end of invert region at cursor
  1067. <ctl-kp3: equateLoc(curFile,eInvert,atCursor) refreshDisplay >
  1068.  
  1069. UNDO scratch deletes, inserting scratch delete buffer at cursor
  1070. <ctl-kp0: runKey(normal-kp0) >
  1071.  
  1072. Give message telling turn OFF columnar if columnar is ON.
  1073. <virtual-kpDot:
  1074.     if (getFlag(curFile,columnar)) {
  1075.         alertuser("Turn OFF columnar display mode first. (See Columnar menu.)")
  1076.         abort
  1077.     } >
  1078.  
  1079. Copy invert region into buffer
  1080. <ctl-kpDot:
  1081.     runKey(virtual-kpDot)
  1082.     if (gtLoc(curFile,eInvert,sInvert)) {
  1083.         freeBuf(buf46)
  1084.         insertRgn(buf46,sFile,curFile,invert)
  1085.         equateLoc(buf46,sPage,sFile)
  1086.     } else returnFalse >
  1087.  
  1088. Copy invert region into buffer, then delete invert region
  1089. <ctl-kpMinus:
  1090.     runKey(virtual-kpDot)
  1091.     runKey(ctl-kpDot)
  1092.     clearRgn(curFile,invert) >
  1093.  
  1094. Insert copied invert region at cursor
  1095. <ctl-kpEnter:
  1096.     runKey(virtual-kpDot)
  1097.         if (is(curFile,sFile)) {
  1098.             equateLoc(curFile,sInvert,atCursor)
  1099.             equateLoc(curFile,eInvert,sInvert)
  1100.         } else {
  1101.             equateLoc(curFile,sInvert,atCursor)
  1102.             decLoc(curFile,sInvert)
  1103.             equateLoc(curFile,eInvert,atCursor)
  1104.         }
  1105.         insertRgn(curFile,atCursor,buf46,all)
  1106.         if (eqLoc(curFile,atCursor,sInvert)) equateLoc(curFile,sInvert,sFile)
  1107.         else incLoc(curFile,sInvert)
  1108.         if (!onScreen(atCursor)) vScroll(atCursor) >
  1109.  
  1110.                         *** miscellaneous keys ***
  1111.  
  1112. Set new line-length
  1113. <ctl-return:
  1114.     putMsg("Enter new line-length:")
  1115.     if (inputNum(n54)) {
  1116.         setLocal(curFile,lineLength,n54)
  1117.         equateNum(lineLength,n54)
  1118.     } >
  1119.  
  1120. Transparent tab forward
  1121. <shft-tab: moveCursor(curFile,eTab) >
  1122.  
  1123. Transparent tab backward
  1124. <alt-tab: moveCursor(curFile,sTab) >
  1125.  
  1126. Untab - delete white space back to previous tab column
  1127. <ctl-tab:
  1128.     equateLoc(curFile,locA,atCursor)
  1129.     moveCursor(curFile,sTab)
  1130.     while (is(curFile,space) | is(curFile,9)) {
  1131.         clearChar(curFile)
  1132.         if (eqLoc(curFile,atCursor,locA)) return
  1133.     }>
  1134.  
  1135. Switch to/from using spaces for tabs or using real tabs
  1136. <altCtl-tab: flipFlag(curFile,trueTabs)>
  1137.  
  1138. Show tab ruler above cursor line
  1139. <shftAlt-tab: seeRuler>
  1140.  
  1141. Set tab ruler using mouse or keys
  1142. <shftCtl-tab:
  1143.     putMsg(
  1144.     "Use mouse click/drag, Tab, Space, BS, Del (anykey=quit,Amiga-ESC=abort)")
  1145.     setRuler putMsg(" ") >
  1146.  
  1147. Convert tabs in document to spaces
  1148. <lAmiga-t: tabsToSpaces >
  1149.  
  1150. Convert spaces in document to TABs
  1151. <rAmiga-t: spacesToTabs >
  1152.  
  1153. Set TAB table number (0-4) to use for TAB spacing
  1154. <shftAltCtl-tab:
  1155.     putMsg("Enter new tab table # (0-4):")
  1156.     if (inputNum(n54) & geNum(n54,0) & geNum(4,n54)) {
  1157.         setLocal(curFile,tabTable,n54)
  1158.         equateNum(tabTable,n54)
  1159.     } >
  1160.  
  1161. Toggle "busies" setting - when turned on, it shows buffers being worked on
  1162. <ctl-b: flipFlag(curFile,busies) >
  1163.  
  1164. Trim spaces between the next two words after cursor
  1165. <alt-c:
  1166.     while (copyChar(curfile,n54)
  1167.         & !(eqNum(n54,32) | eqNum(n54,9) | is(curfile,efile)))
  1168.                 moveCursor(curFile,eChar)
  1169.     moveCursor(curFile,eChar)
  1170.     if (is(curfile,efile)) returnFalse
  1171.     while (copyChar(curfile,n54)
  1172.         & (eqNum(n54,32) | eqNum(n54,9)))
  1173.                 clearChar(curfile) >
  1174.  
  1175. Let next character typed be a CTRL-character, such as formfeed, etc
  1176. <ctl-c:
  1177.     putMsg("Input a control character:")
  1178.     getChar(n54)
  1179.     if (geNum(31,n54) | (geNum(n54,64) & geNum(127,n54))) {
  1180.         and(n54,n54,31)
  1181.         insertChar(curFile,n54)
  1182.     }
  1183.     putMsg(" ") >
  1184.  
  1185. Count number of times the next command is successfully executed
  1186. <shftAlt-c:
  1187.     equateNum(n90,0)
  1188.     putMsg("Input command to execute & count:")
  1189.     if (getKey(n91)) {
  1190.         while (runKey(n91)) incNum(n90)
  1191.         freeBuf(buf54)
  1192.         insertRgn(buf54,sFile,"Times executed = ",all)
  1193.         toWord(buf54,n90)
  1194.         putMsg(buf54)
  1195.     } >
  1196.  
  1197. Delay the amount of time (tenths of seconds) stored using shftAlt-d
  1198. <alt-d: delay(n46) >
  1199.  
  1200. Delete cursor line, storing it in Undo buffer.  (See keypad-0/7/9.)
  1201. <ctl-d: runKey(virtual-x)
  1202. >
  1203.  
  1204. Delete cursor line
  1205. <virtual-x:
  1206.     if (!eqLoc(curFile,locB,atCursor)) freeBuf(buf45)
  1207.     equateLoc(curFile,locB,atCursor)
  1208.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1209.     if (!eqLoc(curFile,locB,atCursor)) {
  1210.         equateLoc(curFile,locA,atCursor)
  1211.         insertRgn(buf45,sFile,curFile,loc)
  1212.         clearRgn(curFile,loc)
  1213.     } else equateLoc(curFile,locA,atCursor)
  1214.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1215.     moveCursor(curFile,eChar)
  1216.     equateLoc(curFile,locB,atCursor)
  1217.     insertRgn(buf45,eFile,curFile,loc)
  1218.     equateLoc(buf45,sPage,sFile)
  1219.     clearRgn(curFile,loc) >
  1220.  
  1221. Set the delay variable to some value in tenths of seconds
  1222. <shftAlt-d:
  1223.     putMsg("Input # tenths of seconds (used in delays)")
  1224.     inputNum(n46) >
  1225.  
  1226. Change end-of-line character
  1227. <alt-e:
  1228.     putMsg("Input new end-of-line value (usually 10 or 13):")
  1229.     inputNum(n54)
  1230.     setEol(n54)
  1231.     refreshDisplay >
  1232.  
  1233. Change current document's end-of-line character
  1234. <ctl-e:
  1235.     putMsg("Input file's current end-of-line value (usually 10 or 13):")
  1236.     inputNum(n54)
  1237.     if (!gtNum(n54,0)) returnFalse
  1238.     putMsg("Input new end-of-line value (usually 10 or 13):")
  1239.     inputNum(n53)
  1240.     if (!gtNum(n53,0)) returnFalse
  1241.     setEol(n54)
  1242.     moveCursor(curFile,sFile)
  1243.     putMsg("Changing eol characters... Amiga-ESC=abort.")
  1244.     if (is(curFile,n54)) swapChar(curFile,n53)
  1245.     while (moveCursor(curFile,eLine))
  1246.         if (is(curFile,n54)) swapChar(curFile,n53)
  1247.     setEol(n53)
  1248.     vScroll(sFile)
  1249.     putMsg(" ")
  1250.     refreshDisplay >
  1251.  
  1252. Input the number of buffer to free
  1253. <alt-f:
  1254.     putMsg("Input buffer # to free:")
  1255.     if (inputNum(n54)) freeBuf(buf[n54]) >
  1256.  
  1257. Flip upper/lower case of char under cursor
  1258. <ctl-f:
  1259.     if (is(curFile,alpha)) {
  1260.         if (is(curFile,lowerCase)) toUpper(curFile)
  1261.         else toLower(curFile)
  1262.     }
  1263.     moveCursor(curFile,eChar) >
  1264.  
  1265. Toggle the mark-gadgets setting.  When "off", the gadget names don't show
  1266. <ctl-g: flipFlag(curFile,markGadgets) >
  1267.  
  1268. Input a new lines/page value
  1269. <alt-g:
  1270.     putMsg("Enter new lines/page setting:")
  1271.     inputNum(n54)
  1272.     if (gtNum(n54,0)) {
  1273.         setLocal(curFile,pageLines,n54)
  1274.         equateNum(pageLines,n54)
  1275.     } >
  1276.  
  1277. Uncolor the hilite region
  1278. <alt-h: equateLoc(curFile,sHilite,eHilite) refreshDisplay >
  1279.  
  1280. Erase hilite region.  No Copy is made!
  1281. <ctl-h: clearRgn(curFile,hilite) >
  1282.  
  1283. Uncolor the invert region
  1284. <alt-i: equateLoc(curFile,sInvert,eInvert) refreshDisplay >
  1285.  
  1286. Erase the invert region.  No Copy is made!
  1287. <ctl-i: clearRgn(curFile,invert) >
  1288.  
  1289. Scan index buffer, build an index.  (See shftAlt-buttonDown/buttonUp.)
  1290. <shftAlt-i:
  1291.     if (isEmpty(buf41)) returnFalse
  1292.     runKey(alt-g)            .. Could elim.  get lines-per-page setting to use
  1293.     freeBuf(buf54)
  1294.     putMsg("Working....")                    .. erase duplicate items in buf41
  1295. label(10)                                               .. get next index item
  1296.     moveCursor(buf41,sFile)
  1297.     while (is(buf41,whiteSpace)) clearChar(buf41)     .. clear any blank lines
  1298.     if (is(buf41,eFile)) goto label(11)            .. done finding duplicates
  1299.     equateLoc(buf41,sInvert,atCursor)                            .. mark start
  1300.     moveCursor(buf41,downLine)
  1301.     equateLoc(buf41,eInvert,atCursor)                              .. mark end
  1302.     freeBuf(buf49)
  1303.     insertRgn(buf49,eFile,buf41,invert)                 .. copy item to buf49
  1304.     clearRgn(buf41,invert)                                .. erase from buf41
  1305.     insertRgn(buf54,eFile,buf49,all)                       .. add it to buf54
  1306.     moveCursor(buf41,eFile)                           .. search bkwd for dups
  1307.     setSearch(buf49)
  1308.     while (search(buf41,sInvert,eInvert,-1)) clearRgn(buf41,invert).. del dup
  1309.     goto label(10)                  .. get next item, unless buf41 empty now.
  1310. label(11)
  1311.     freeBuf(buf41)                                           .. starting over
  1312.     insertRgn(buf41,eFile,buf54,all)            .. store no-dup list in buf41
  1313.     freeBuf(buf54)                                 .. erase old list in buf54
  1314. label(1)                            .. NOTE: should have used swapBuf instead
  1315.     moveCursor(buf41,sFile)
  1316.     while (is(buf41,whiteSpace)) clearChar(buf41)    .. clear lead white space
  1317.     if (is(buf41,eFile)) {                   .. buf41 empty, must be finished
  1318.         swapBuf(buf54,buf41)                            .. index was in buf54
  1319.         freeBuf(buf54)
  1320.         setFileName(buf41,"Index")
  1321.         equateLoc(buf41,sPage,sFile)
  1322.         equateLoc(buf41,atCursor,sFile)
  1323.         putMsg("Press ctl-w to see Index")                        .. finished
  1324.         return
  1325.     }
  1326.     freeBuf(buf49)
  1327.     insertRgn(buf49,sFile,buf41,line)         .. load search string with item.
  1328.     clearRgn(buf41,line)                                    .. erase the item
  1329.     putMsg(buf49)                                             .. show the item
  1330.     moveCursor(buf54,eFile)              .. put item at end of index building
  1331.     insertRgn(buf54,eFile,buf49,all)
  1332.     insertRgn(buf54,eFile,"  ",all)        .. space before page #s that go in
  1333.     insertChar(buf54,eLine)
  1334.     moveCursor(buf54,sChar)
  1335.     equateNum(n53,0)                                 .. so know if need comma
  1336.     moveCursor(curFile,sFile)
  1337.     label(2)
  1338.     setSearch(buf49)
  1339.     while (search(curFile,sInvert,eInvert,1)) {
  1340.         moveCursor(curFile,sChar)
  1341.         if (is(curFile,alpha)) {
  1342.             label(3)                       .. part of a bigger word so ignore
  1343.             moveCursor(curFile,eInvert)
  1344.             goto label(2)                                 .. and resume search
  1345.         }
  1346.         if (is(curFile,digit)) goto label(3)   .. part of bigger word, ignore
  1347.         moveCursor(curFile,eInvert)
  1348.         if (is(curFile,alpha)
  1349.              | is(curFile,digit)) goto label(2).. part of bigger word, ignore
  1350.         getPageRowCol(n54,n50,n49)                       .. this uses display
  1351.         moveCursor(curFile,eForm)           .. don't search again on this page
  1352.         if (!eqNum(n53,0)) insertChar(buf54,",")    .. put comma if not 1st #
  1353.         toWord(buf54,n54)               .. install the page # after index item
  1354.         equateNum(n53,n54)         .. so will put in comma next time for sure
  1355.     }
  1356.     goto label(1)                                  .. get next item from buf41
  1357. >
  1358.  
  1359. Toggle the "make icons" flag.  When "on", Workbench icons are created
  1360. <altCtl-i: flipFlag(curFile,icons)>
  1361.  
  1362. Enter idle-timer value (tenths of sec) after which idle command executed
  1363. <shftAltCtl-i:
  1364.     putMsg("Input idle time (tenths of a second)")
  1365.     if (inputNum(n54)) equateNum(idleTime,n54)>
  1366.  
  1367. Toggle the right-justify typing mode
  1368. <alt-j: flipFlag(curFile,rightJustify) >
  1369.  
  1370. Join next line to cursor line
  1371. <ctl-j:
  1372.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1373.     equateLoc(curFile,locA,atCursor)
  1374.     while (moveCursor(curFile,eChar)
  1375.         & (is(curFile,space) | is(curFile,9))) nothing
  1376.     equateLoc(curFile,locB,atCursor)
  1377.     clearRgn(curFile,loc)
  1378.     insertChar(curFile," ") >
  1379.  
  1380. Move the hilite to the left by one character (space or tab)
  1381. <alt-l:
  1382.     moveCursor(curFile,sHilite)
  1383.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1384. label(1)
  1385.     if (is(curFile,space) | is(curFile,9)) clearChar(curFile)
  1386.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1387.     moveCursor(curFile,eChar)                            .. start of next line
  1388.     if (gtLoc(curFile,eHilite,atCursor)) goto label(1) >
  1389.  
  1390. Convert the character under the cursor to lower case and move cursor fwd
  1391. <ctl-l:
  1392.     toLower(curFile)
  1393.     moveCursor(curFile,eChar) >
  1394.  
  1395. Set bottom margin
  1396. <lAmiga-l:
  1397.     putMsg("Input bottom margin lines (0-200):")
  1398.     if (inputNum(n54)) equateNum(bottomMargin,n54)
  1399.     setLocal(curFile,bottomMargin,bottomMargin)>
  1400.  
  1401. Set command multiplier to use for next command
  1402. <ctl-m: putMsg("Input command multiplier:") inputNum(cmdMultiplier) >
  1403.  
  1404. Swap the mouse's button-Up operation with the next key-command pressed
  1405. <alt-m:
  1406.     putMsg("Will swap mouse buttonUp with your next input:")
  1407.     if (getKey(n53) & swapKey(n53,normal-buttonUp)) {
  1408.         putMsg("Swapped - to undo, do it again")
  1409.         return
  1410.     }
  1411.     putMsg(" ") >
  1412.  
  1413. Map illegal ASCII (0 thru 5) characters into safe ones.  (See top of Config!)
  1414. <shftAlt-m: flipFlag(curFile,mapChars)>
  1415.  
  1416. Rename the document in the window
  1417. <alt-n:
  1418.     putMsg("Input new filename:")
  1419.     getFileName(buf43,curFile)
  1420.     if (inputString(buf43))
  1421.     setFileName(curFile,buf43) >
  1422.  
  1423. Input a text line number to go to
  1424. <ctl-n:
  1425.     putMsg("Input line number:")
  1426.     if (inputNum(n54)) {
  1427.         lineToLoc(curFile,atCursor,n54)
  1428.         vScroll(atCursor)
  1429.     } >
  1430.  
  1431. Open the cursor line for typing
  1432. <ctl-o:
  1433.     insertChar(curFile,eLine)
  1434.     moveCursor(curFile,sChar) >
  1435.  
  1436. Move the hilite region to the right by one space
  1437. <alt-r:
  1438.     moveCursor(curFile,sHilite)
  1439.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1440.     while (gtLoc(curFile,eHilite,atCursor)) {
  1441.         insertChar(curFile,32)
  1442.         if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1443.         moveCursor(curFile,eChar)
  1444.     } >
  1445.  
  1446. Terminate Learn Mode or run whatever is stored in learn-buffer.  (See ctl-s.)
  1447. <ctl-r: runLearn  >
  1448.  
  1449. Speak the hilite region
  1450. <alt-s:
  1451.     if (gtLoc(curFile,eHilite,sHilite)) {
  1452.         freeBuf(buf50)
  1453.         insertRgn(buf50,eFile,curFile,hilite)
  1454.         speak(buf50)
  1455.     } >
  1456.  
  1457. Start/abort Learn Mode.  (Use ctl-r to finish & to run it.)
  1458. <ctl-s:
  1459.     if (!getFlag(curFile,learnMode)) putMsg("LEARN MODE ACTIVE!")
  1460.     else putMsg("Learn Mode cancelled.")
  1461.     flipFlag(curFile,learnMode) >
  1462.  
  1463. Line sort:  sorts stacked list of words/phrases (removes duplicates).
  1464. <shftAlt-s:
  1465.     movecursor(curfile,sfile)
  1466.     refreshdisplay
  1467.     runKey(lAmiga-t)                                .. convert tabs to spaces
  1468.     putMsg("Del trail white...")
  1469.     runKey(ctl-4)                                .. clear trailing white space
  1470.     moveCursor(curfile,sfile)
  1471.     putMsg("Del blank lines...")
  1472. label(0)
  1473.     if (is(curfile,eline)) clearChar(curfile)
  1474.     else moveCursor(curfile,downLine)
  1475.     if (not is(curfile,efile)) goto label(0)
  1476.     movecursor(curfile,sfile)
  1477.     refreshdisplay
  1478.  
  1479.     putMsg("Sorting")
  1480.     .. count lines
  1481.     movecursor(curfile,sfile)
  1482.     equateNum(n54,0)
  1483.     while (moveCursor(curfile,downline)) incNum(n54)
  1484.     if (gtNum(2,n54)) returnFalse                           .. too few to sort
  1485.     equateNum(n53,n54)      .. store MAX
  1486.  
  1487.     while (nothing) {     .. while (gap >>= 1)
  1488.         div(n54,n54,2)
  1489.         if (eqNum(n54,0)) {
  1490.             moveCursor(curfile,sfile)
  1491.             refreshdisplay
  1492.             putMsg("Done")
  1493.             return
  1494.         }
  1495. label(20)
  1496.         equateNum(n50,0)    .. swapped = FALSE
  1497.         putMsg(n54) .. show gap size
  1498.         fileSize(curfile,n0)
  1499.  
  1500.         moveCursor(curfile,sfile)    .. cursor at start of file
  1501.         refreshdisplay
  1502.         swapLoc(curfile,atcursor,loca)
  1503.         moveCursor(curfile,sfile)
  1504.         equateNum(n51,n54)  .. put locA 1 gap distance from sof
  1505.         while (decNum(n51)) moveCursor(curfile,downline)
  1506.         swapLoc(curfile,atCursor,loca)  .. now ready
  1507.  
  1508.         while (nothing) {
  1509.             clearRgn(buf48,all)
  1510.             clearRgn(buf49,all)
  1511.             insertRgn(buf48,efile,curfile,line) .. copy cursor line
  1512.             swapLoc(curfile,atcursor,loca)
  1513.             insertRgn(buf49,efile,curfile,line) .. copy locA line
  1514.             swapLoc(curfile,atcursor,loca)
  1515.             if (isEmpty(buf49) | isEmpty(buf48)) goto label(21)
  1516.             if (stringComp(n49,buf49,buf48,1)) { .. delete duplicate
  1517.                 if (stringComp(n49,buf49,buf48,0)) { .. true dup?
  1518.                     clearRgn(curfile,line)
  1519.                     clearChar(curfile)
  1520.                     equateNum(n50,1) .. swapped = TRUE, force a rerun
  1521.                     moveCursor(curfile,sline)
  1522.                     putMsg(buf48)
  1523.                 }
  1524.             } else if (gtNum(0,n49)) {  .. not alpha order, swap them
  1525.                 clearRgn(curfile,line)
  1526.                 insertRgn(curfile,atcursor,buf49,all)
  1527.                 moveCursor(curfile,sLine)    .. start of this line
  1528.                 swapLoc(curfile,atcursor,loca)
  1529.                 clearRgn(curfile,line)
  1530.                 insertRgn(curfile,atcursor,buf48,all)
  1531.                 moveCursor(curfile,sLine)    .. start of this line
  1532.                 swapLoc(curfile,atcursor,loca)
  1533.                 equateNum(n50,1) .. swapped = TRUE
  1534.                 putMsg(buf48)
  1535.             }
  1536.             moveCursor(curfile,eLine)
  1537.             moveCursor(curfile,eChar)
  1538.             swapLoc(curfile,atcursor,loca)
  1539.             moveCursor(curfile,eLine)
  1540.             moveCursor(curfile,eChar)
  1541.             swapLoc(curfile,atcursor,loca)
  1542.         }
  1543. label(21)
  1544.         if (eqNum(n50,1)) goto label(20) .. got swaps, go again
  1545.     }
  1546.  
  1547. >
  1548.  
  1549. Show key-help message on next key pressed.  Copy key-help to RAM: on first
  1550. <ctl-t:
  1551.     putMsg("Input a key, gadget, click etc to get Help msg")
  1552.     getKey(n54)
  1553.     teachOne(n54)>
  1554.  
  1555. Toggle between using printable keys for commands or for normal typing input
  1556. <alt-u: flipFlag(curFile,useKeys)>
  1557.  
  1558. Load UStar config
  1559. <virtual-u:
  1560.     if (!loadConfig("UstarData!")) loadConfig("S:UstarData!") >
  1561.  
  1562. Convert char under cursor to upper case
  1563. <ctl-u:
  1564.     toUpper(curFile)
  1565.     moveCursor(curFile,eChar) >
  1566.  
  1567. Set left margin
  1568. <lAmiga-m:
  1569.     putMsg("Input left margin column (0-200):")
  1570.     if (inputNum(n54)) equateNum(leftMargin,n54)
  1571.     setLocal(curFile,leftMargin,leftMargin)>
  1572.  
  1573. Set top margin
  1574. <lAmiga-u:
  1575.     putMsg("Input top margin lines (0-200):")
  1576.     if (inputNum(n54)) equateNum(topMargin,n54)
  1577.     setLocal(curFile,topMargin,topMargin)>
  1578.  
  1579. Switch flag that makes CTRL chars vis/invis
  1580. <ctl-v: flipFlag(curFile,spooks) refreshDisplay >
  1581.  
  1582. Swap the current document in window with buffer 41
  1583. <ctl-w: swapBuf(curFile,buf41) >
  1584.  
  1585. Swap current buffer to buffer 0 (the "home" buffer of Uedit)
  1586. <alt-w:
  1587.     swapBuf(buf0,curFile)
  1588.     editBuf(buf0) >
  1589.  
  1590. For programmers:  Toggle number under cursor between hex/decimal
  1591. <ctl-x: hexDecimal(curFile) >
  1592.  
  1593. Execute an AmigaDOS command, but don't collect the results
  1594. <ctl-y:
  1595.     putMsg("Enter AmigaDOS command")
  1596.     freeBuf(buf40)
  1597.     if (inputString(buf40)) execute(" ",buf40) >
  1598.  
  1599. Execute an AmigaDOS command and show the results
  1600. <ctl-z:
  1601.     putMsg("Enter AmigaDOS command")
  1602.     freeBuf(buf40)
  1603.     freeBuf(buf39)
  1604.     if (!inputString(buf40) | !execute(buf39,buf40)) returnFalse
  1605.     if (!isEmpty(buf39)) {
  1606.         putMsg("Result of AmigaDOS command:")
  1607.         flipFlag(buf39,changed)
  1608.         editBuf(buf39)
  1609.         vscroll(sFile)
  1610.         updateDisplay
  1611.         return
  1612.     }
  1613.     putMsg("No reply from AmigaDOS.")
  1614.     freeBuf(buf39) >
  1615.  
  1616. Search for buf53 dirname in buf38.  Add name to list if not there.
  1617. <virtual-7:
  1618.     moveCursor(buf53,eFile)
  1619.     decLoc(buf53,atCursor)
  1620.     if (!is(buf53,"/") & !is(buf53,":")) insertRgn(buf53,eFile,"/",all)
  1621.     if (isEmpty(buf38)) runKey(virtual-8)                 .. default dir names
  1622.                                          .. if (isEmpty(buf38)) goto label(0)
  1623.     moveCursor(buf38,sFile)
  1624.     equateLoc(buf38,eHilite,sHilite)
  1625. label(1)
  1626.     while (is(buf38,whiteSpace)) moveCursor(buf38,eChar)
  1627.     if (is(buf38,eFile)) goto label(0)                              .. add it
  1628.     equateLoc(buf38,sHilite,atCursor)                           .. store start
  1629.     while (!is(buf38,whiteSpace) & !is(buf38,eFile))
  1630.         moveCursor(buf38,eChar)
  1631.     equateLoc(buf38,eHilite,atCursor)                             .. store end
  1632.     freeBuf(buf52)
  1633.     insertRgn(buf52,sFile,buf38,hilite)
  1634.     if (!stringComp(n54,buf53,buf52,1)) goto label(1)             .. try again
  1635.     moveCursor(buf38,sHilite)           .. found dirname.  Put cursor at start
  1636.     goto label(5)
  1637. label(0)                                        .. dirname not found.  Add it
  1638.     moveCursor(buf38,eFile)
  1639.     if (!isEmpty(buf53)) {
  1640.         locToCol(buf38,n54,atCursor)
  1641.         if (gtNum(n54,60)) insertChar(buf38,eLine)
  1642.         else insertChar(buf38,9)                                       .. tab
  1643.     }
  1644.     equateLoc(buf38,sHilite,eFile)
  1645.     decLoc(buf38,sHilite)
  1646.     insertRgn(buf38,eFile,buf53,all)         .. install new dirname as curdir
  1647.     equateLoc(buf38,eHilite,eFile)
  1648.     incLoc(buf38,sHilite)
  1649.     moveCursor(buf38,sHilite)
  1650.     equateNum(n54,curFile)
  1651. label(5)
  1652.     freeBuf(buf53)
  1653.     if (!eqNum(n54,38) & gotoSplit(buf38)) gotoSplit(buf[n54])..force refresh
  1654.     runKey(virtual-9)
  1655. >
  1656.  
  1657. Load beginning directory names into buf38
  1658. <virtual-8:
  1659.     if (isEmpty(buf38)) {
  1660.         if (!insertFile(buf38,eFile,"S:Directories"))
  1661.            insertRgn(buf38,eFile," DF0:    DF1:    DH0:    S:    RAM:    VD0:",all)
  1662.         moveCursor(buf38,eFile)
  1663.         equateLoc(buf38,sHilite,eHilite)
  1664.         equateLoc(buf38,mouseLoc,eFile)
  1665.      }
  1666.      equateLoc(buf38,sPage,sFile) >
  1667.  
  1668. Put up msg telling what click-loading directory now is.
  1669. <virtual-9:
  1670.     freeBuf(buf53)
  1671.     insertRgn(buf53,eFile,"Click-loading directory = ",all)
  1672.     if (gtLoc(buf38,eHilite,sHilite)) insertRgn(buf53,eFile,buf38,hilite)
  1673.     else insertRgn(buf53,eFile,"default",all)
  1674.     putMsg(buf53)
  1675.     freebuf(buf53) >
  1676.  
  1677. Get listing. (Also sets directoryname used in ctl-buttonDown.)
  1678. <alt-z:
  1679.     putMsg("Enter directory: ")
  1680.     freeBuf(buf53)
  1681.     if (inputString(buf53)) runKey(virtual-7)
  1682.     freeBuf(buf54)
  1683.     insertRgn(buf54,eFile,"Dir ",all)
  1684.     insertRgn(buf54,eFile,buf38,hilite)
  1685.     if (!execute(buf39,buf54)) returnFalse
  1686.     moveCursor(buf39,sFile)
  1687.     insertChar(buf39,eLine)
  1688.     insertRgn(buf39,sFile,buf38,hilite)
  1689.     newFile
  1690.     swapBuf(buf39,curFile)
  1691.     freeBuf(buf39)
  1692.     vScroll(sFile)
  1693.     putMsg("To load files, ctrl-click names with mouse.")
  1694.     setFileName(curFile,buf54)
  1695.     flipFlag(curFile,changed) >
  1696.  
  1697. Change the current working directory
  1698. <altCtl-z:
  1699.     putMsg("Change current directory to (may not work in Workbench):")
  1700.     freeBuf(buf53)
  1701.     if (inputString(buf53)) changeDir(buf53) >
  1702.  
  1703. Clear leading white space in cursor line
  1704. <alt-1:
  1705.     equateLoc(curFile,locA,atCursor)
  1706.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1707.     while (is(curFile,whiteSpace) & !is(curFile,eLine) & !is(curFile,12))
  1708.                 clearChar(curFile)
  1709.     equateLoc(curFile,atCursor,locA) >
  1710.  
  1711. Center text in the line.  (Uses current line length.)
  1712. <alt-2:
  1713.     runKey(alt-1)                                 .. clear leading white space
  1714.     if (is(curFile,blankLine)) returnFalse
  1715.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1716.     locToCol(curFile,n53,atCursor)
  1717.     getLocal(curFile,n54,lineLength)
  1718.     if (gtNum(n54,n53)) {
  1719.         moveCursor(curFile,sLine)
  1720.         incNum(n54)
  1721.         sub(n53,n54,n53)
  1722.         div(n53,n53,2)
  1723.         do (n54,1,n53) insertChar(curFile," ")
  1724.     } >
  1725.  
  1726. Match indent of cursor line to previous line
  1727. <alt-4:
  1728.     equateNum(n54,0)
  1729.     moveCursor(curFile,upLine)
  1730.     if (!getFlag(curFile,autoIndent)) {
  1731.         flipFlag(curFile,autoIndent)
  1732.         equateNum(n54,1)
  1733.     }
  1734.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1735.     clearChar(curFile)
  1736.     typeChar(eLine)
  1737.     if (eqNum(n54,1)) flipFlag(curFile,autoIndent)
  1738.     moveCursor(curFile,downLine) >
  1739.  
  1740. Right-align the cursor line from cursor rightward
  1741. <alt-5:
  1742.     if (!is(curFile,whiteSpace)) moveCursor(curFile,sChar)
  1743.     if (is(curFile,eLine)) return
  1744.     while (is(curFile,whiteSpace) & !is(curFile,sLine)) {
  1745.         clearChar(curFile)
  1746.         moveCursor(curFile,sChar)
  1747.     }
  1748.     moveCursor(curFile,eChar)
  1749.     equateLoc(curFile,locA,atCursor)
  1750.     if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1751.     locToCol(curFile,n54,atCursor)
  1752.     decNum(n54)
  1753.     getLocal(curFile,n53,lineLength)
  1754.     sub(n54,n53,n54)
  1755.     moveCursor(curFile,locA)
  1756.     if (gtNum(n54,0)) while (decNum(n54)) insertChar(curFile," ") >
  1757.  
  1758. Show the value of a number variable
  1759. <alt-8:
  1760.     putMsg("n-variable #: ")
  1761.     inputNum(n54)
  1762.     freeBuf(buf54)
  1763.     insertChar(buf54,"n")
  1764.     toWord(buf54,n54)
  1765.     insertRgn(buf54,eFile," is ",all)
  1766.     toWord(buf54,n[n54])
  1767.     putMsg(buf54) >
  1768.  
  1769. Set the value of a number variable
  1770. <alt-9:
  1771.     putMsg("Set n-variable #:")
  1772.     inputNum(n54)
  1773.     putMsg("To value:")
  1774.     inputNum(n[n54])>
  1775.  
  1776. Show the ASCII value of the character under the cursor
  1777. <ctl-/:
  1778.     copyChar(curFile,n54)
  1779.     freeBuf(buf54)
  1780.     toWord(buf54,n54)
  1781.     insertRgn(buf54,sFile,"Character value under cursor was ",all)
  1782.     putMsg(buf54)
  1783.     moveCursor(curFile,eChar) >
  1784.  
  1785. Show the current document size
  1786. <ctl-1:
  1787.     fileSize(curFile,n54)
  1788.     freeBuf(buf54)
  1789.     insertRgn(buf54,sFile,"File size in bytes: ",all)
  1790.     toWord(buf54,n54)
  1791.     putMsg(buf54)>
  1792.  
  1793. Switch displaying of cursor row-column off/on
  1794. <ctl-2: flipFlag(curFile,rowCol) >
  1795.  
  1796. This is a simple reformat cmd that doesn't refmt indented paragraphs.
  1797. .. <ctl-3: if (reformat) moveCursor(curFile,downLine) >
  1798.  
  1799. Reformat cursor paragraph, starting at cursor line
  1800. <ctl-3:                   .. move down, if blank line, to find par beginning.
  1801.     while (is(curFile,blankLine)) {
  1802.         moveCursor(curFile,downLine)
  1803.         if (!is(curFile,eLine)) moveCursor(curFile,eLine)
  1804.         if (is(curFile,eFile)) returnFalse
  1805.     }
  1806.     equateNum(n3,0)                                      .. a flag used below
  1807.     equateLoc(curFile,locA,atCursor)                   .. store par beginning
  1808. label(2)                                        .. get indent of 1st par line
  1809.     if (!is(curFile,sLine)) moveCursor(curFile,sLine)
  1810.     while (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
  1811.     locToCol(curFile,n0,atCursor)                 .. get the 1st line's indent
  1812.  
  1813.     if (eqNum(n3,0)) {                                 .. if doing FIRST line
  1814.         equateNum(n1,n0)                      .. store indent of 1st par line
  1815.         equateNum(n3,1)                 .. set a flag so won't come back here
  1816.         equateLoc(curFile,locB,atCursor)           .. store 1st text location
  1817.         moveCursor(curFile,downLine)                      .. move to 2nd line
  1818.         if (is(curFile,blankLine)) {                        .. no second line
  1819.             equateNum(n0,1)
  1820.             goto label(3)
  1821.         }
  1822.         goto label(2)                .. go back and get indent of 2nd par line
  1823.     }
  1824. label(3)
  1825.     moveCursor(curFile,upLine)                       .. move back to 1st line
  1826.     equateNum(n2,n0)                              .. store indent of 2nd line
  1827.  
  1828.     if (eqNum(n2,-1) | geNum(n2,n1)) {                  .. was no 2nd line or
  1829.         reformat                       .. 2nd line inset, so do only 1st line
  1830.         goto label(5)                                              .. finished
  1831.     } else {                             .. 2nd line has less or equal indent
  1832.         sub(n1,n1,n2)                     .. par indent = 1st indent minus 2nd
  1833.         colToLoc(curFile,atCursor,n2)
  1834.         equateLoc(curFile,locA,atCursor)
  1835.         clearRgn(curFile,loc)              .. wiping out extra 1st line indent
  1836.         do (n54,1,n1) insertChar(curFile,"x")                 .. repl with x's
  1837.         moveCursor(curFile,sWord)                          .. made a FAKE WORD
  1838.         equateLoc(curFile,locA,atCursor)                     .. store its loc
  1839.         reformat                              .. now paragrah has SAME indent
  1840.         equateLoc(curFile,locB,atCursor)                  .. store end of par
  1841.         moveCursor(curFile,locA)                      .. go back to fake word
  1842.         while (is(curFile,"x")) {                       .. swap x's for spaces
  1843.             swapChar(curFile," ")
  1844.             moveCursor(curFile,eChar)
  1845.         }                                             .. now fake word is gone
  1846.         equateLoc(curFile,atCursor,locB)                   .. goto end of par
  1847. label(5)
  1848.         moveCursor(curFile,downLine)                       .. leave paragraph
  1849.     }
  1850. >
  1851.  
  1852. Delete all trailing white-space in current document
  1853. <ctl-4:
  1854.     equateLoc(curFile,locA,atCursor)
  1855.     moveCursor(curFile,sFile)
  1856.     while (nothing) {
  1857.         if (is(curFile,eFile))
  1858.             { equateLoc(curFile,atCursor,locA) return }
  1859.         moveCursor(curFile,eLine)
  1860.         moveCursor(curFile,sChar)
  1861.         while (is(curFile,space) | is(curFile,9))
  1862.             { clearChar(curFile) moveCursor(curFile,sChar) }
  1863.         moveCursor(curFile,eLine)
  1864.     } >
  1865.  
  1866. Save a learn-sequence to disk, saving it under a Name
  1867. <ctl-5:
  1868.     putMsg("Save learn seq under what Name?")
  1869.     freeBuf(buf54)
  1870.     if (inputString(buf54) & !saveLearn(buf54))
  1871.                 putMsg("Couldn't save") >
  1872.  
  1873. Load a learn-sequence stored on disk
  1874. <ctl-6:
  1875.     putMsg("Load what learn seq Name?")
  1876.     freeBuf(buf54)
  1877.     if (inputString(buf54) & !loadLearn(buf54))
  1878.                 putMsg("Not found") >
  1879.  
  1880. Load and run learn-sequence stored on disk
  1881. <ctl-7:
  1882.     putMsg("Load & run what learn seq Name?")
  1883.     freeBuf(buf54)
  1884.     if (inputString(buf54) & loadLearn(buf54)) runLearn
  1885.     else putMsg("Not found") >
  1886.  
  1887. Toggle case-sensitivity of search
  1888. <ctl-8: flipFlag(curFile,searchCaps) >
  1889.  
  1890.                         *** arithmetic commands ***
  1891.  
  1892. Set running arithmetic total to zero
  1893. <ctl-0: equateNum(n49,0) >
  1894.  
  1895. Type the running arithmetic total into text at cursor
  1896. <ctl-\:
  1897.     freeBuf(buf54)
  1898.     div(n52,n49,100)
  1899.     if (gtNum(0,n49)) if (eqNum(n52,0)) insertChar(buf54,"-")
  1900.     toWord(buf54,n52)
  1901.     insertChar(buf54,".")
  1902.     if (gtNum(0,n49)) mul(n52,n49,-1)
  1903.     else equateNum(n52,n49)
  1904.     mod(n52,n52,100)
  1905.     if (gtNum(10,n52)) insertChar(buf54,"0")
  1906.     toWord(buf54,n52)
  1907.     insertRgn(curFile,atCursor,buf54,all)
  1908.     insertRgn(buf54,sFile,"Inserted total into text ",all)
  1909.     putMsg(buf54) >
  1910.  
  1911. Add the next word (if a number) to arithmetic total & display total
  1912. <ctl-=:
  1913.     moveCursor(curFile,eWord)
  1914.     moveCursor(curFile,sWord)
  1915.     if (!is(curFile,digit)) returnFalse
  1916.     toNumber(n54,curFile)
  1917.     moveCursor(curFile,eWord)
  1918.     if (is(curFile,".")) {
  1919.         moveCursor(curFile,eChar)
  1920.         if (!is(curFile,digit)) goto label(1)
  1921.         toNumber(n53,curFile)
  1922.         moveCursor(curFile,eChar)
  1923.         if (!is(curFile,digit)) {
  1924.             mul(n53,n53,10)
  1925.             moveCursor(curFile,sChar)
  1926.         }
  1927.         moveCursor(curFile,eWord)
  1928.     } else { label(1) equateNum(n53,0) }
  1929.     mul(n54,n54,100)
  1930.     if (gtNum(0,n54)) mul(n52,n53,-1)
  1931.     else equateNum(n52,n53)
  1932.     add(n54,n54,n52)
  1933.     add(n49,n49,n54)
  1934.     freeBuf(buf54)
  1935.     div(n52,n49,100)
  1936.     if (gtNum(0,n49) & eqNum(n52,0)) insertChar(buf54,"-")
  1937.     toWord(buf54,n52)
  1938.     insertChar(buf54,".")
  1939.     mod(n52,n49,100)
  1940.     if (gtNum(0,n49)) mul(n52,-1,n52)
  1941.     if (gtNum(10,n52)) insertChar(buf54,"0")
  1942.     toWord(buf54,n52)
  1943.     insertRgn(buf54,sFile,"Running total is ",all)
  1944.     putMsg(buf54) >
  1945.  
  1946. Subtract the next word (if a number) from arithmetic total & display total
  1947. <ctl--:
  1948.     moveCursor(curFile,eWord)
  1949.     moveCursor(curFile,sWord)
  1950.     if (!is(curFile,digit)) returnFalse
  1951.     toNumber(n54,curFile)
  1952.     moveCursor(curFile,eWord)
  1953.     if (is(curFile,".")) {
  1954.         moveCursor(curFile,eChar)
  1955.         if (!is(curFile,digit)) goto label(1)
  1956.         toNumber(n53,curFile)
  1957.         moveCursor(curFile,eChar)
  1958.         if (!is(curFile,digit)) {
  1959.             mul(n53,n53,10)
  1960.             moveCursor(curFile,sChar)
  1961.         }
  1962.         moveCursor(curFile,eWord)
  1963.     } else {
  1964. label(1)
  1965.         equateNum(n53,0)
  1966.     }
  1967.     mul(n54,n54,100)
  1968.     if (gtNum(0,n54)) mul(n52,n53,-1)
  1969.     else equateNum(n52,n53)
  1970.     add(n54,n54,n52)
  1971.     sub(n49,n49,n54)
  1972.     freeBuf(buf54)
  1973.     div(n52,n49,100)
  1974.     if (gtNum(0,n49) & eqNum(n52,0)) insertChar(buf54,"-")
  1975.     if (gtNum(0,n49)) insertChar(buf54,"-")
  1976.     toWord(buf54,n52)
  1977.     insertChar(buf54,".")
  1978.     mod(n52,n49,100)
  1979.     if (gtNum(0,n52)) mul(n52,n52,-1)
  1980.     if (gtNum(10,n52)) insertChar(buf54,"0")
  1981.     toWord(buf54,n52)
  1982.     insertRgn(buf54,sFile,"Running total is ",all)
  1983.     putMsg(buf54) >
  1984.  
  1985.                            *** columnar data ***
  1986.  
  1987. Put up msg saying turn ON columnar if it is OFF.
  1988. <virtual-`:
  1989.     if (!getFlag(curFile,columnar)) {
  1990.         alertUser("Turn ON columnar display mode first.  (See Columnar menu.)")
  1991.         abort
  1992.     } >
  1993.  
  1994. Toggle between columnar display and regular hilite/invert display mode
  1995. <shftCtl-`:
  1996.     flipFlag(curFile,columnar)
  1997.     refreshDisplay >
  1998.  
  1999. Copy and then clear the hilited columnar data
  2000. <shftCtl-1:
  2001.     runKey(virtual-`)
  2002.     freeBuf(buf37)
  2003.     copyColData(buf37,sFile,curFile,hilite,1)
  2004.     clearColData(curFile,hilite,0)  >
  2005.  
  2006. Space-fill the hilited columnar data, overlaying the original text.  No copy
  2007. <shftCtl-2:
  2008.     runKey(virtual-`)
  2009.     clearColData(curFile,hilite,1) >
  2010.  
  2011. Copy the hilited columnar data into a buffer
  2012. <shftCtl-3:
  2013.     runKey(virtual-`)
  2014.     if (geLoc(curFile,sHilite,eHilite)) returnFalse
  2015.     freeBuf(buf37) copyColData(buf37,sFile,curFile,hilite,1)>
  2016.  
  2017. Insert copied columnar data at the cursor
  2018. <shftCtl-4:
  2019.     runKey(virtual-`)
  2020.     copyColData(curFile,atCursor,buf37,all,1)>
  2021.  
  2022. Overlay copied columnar data onto existing text at the cursor
  2023. <shftCtl-5:
  2024.     runKey(virtual-`)
  2025.     copyColData(curFile,atCursor,buf37,all,0)>
  2026.  
  2027. Insert the columnar hilite region at the cursor.  (No intermediate copy.)
  2028. <shftCtl-6:
  2029.     runKey(virtual-`)
  2030.     copyColData(curFile,atCursor,curFile,hilite,1)>
  2031.  
  2032. Overlay the columnar hilite region onto existing text at the cursor
  2033. <shftCtl-7:
  2034.     runKey(virtual-`)
  2035.     copyColData(curFile,atCursor,curFile,hilite,0)>
  2036.  
  2037.                           *** interlace mode ***
  2038.  
  2039. Switch to/from interlace display mode
  2040. <shft-esc: flipFlag(curFile,lace)>
  2041.  
  2042. Switch to regular screen, 1 bitplane
  2043. <rAmiga-f1: setLocal(curfile, lace, 1) >
  2044.  
  2045. Switch to regular screen, 2 bitplanes
  2046. <rAmiga-f2: setLocal(curfile, lace, 0) >
  2047.  
  2048. Switch to lace screen, 1 bitplane
  2049. <rAmiga-f3: setLocal(curfile, lace, 3) >
  2050.  
  2051. Switch to lace screen, 2 bitplanes
  2052. <rAmiga-f4: setLocal(curfile, lace, 2) >
  2053.  
  2054. Tune the RGB colors in interlace using mouse.  (See alt-Help also.)
  2055. <alt-esc: laceColor>
  2056.  
  2057. Toggle scroll type in range 0-2
  2058. <rAmiga-s:
  2059.     toggle(scrollType)
  2060.     putMsg(scrollType) >
  2061.  
  2062. Toggle hide-display off/on
  2063. <rAmiga-h:
  2064.     toggle(hideDisplay)
  2065.     putMsg(hideDisplay) >
  2066.  
  2067. Assign a name to one of the 4 gadgets (1-4)
  2068. <ctl-esc:
  2069.     putMsg("Enter gadget number (1-4):")
  2070.     if (!inputNum(n54) | gtNum(n54,4) | gtNum(1,n54)) returnFalse
  2071.     putMsg("Enter gadget name (one Space to clear):")
  2072.     freeBuf(buf54)
  2073.     inputString(buf54)
  2074.     if (!isEmpty(buf54)) {
  2075.         gadgetName(n54,buf54)
  2076.         putMsg(" ")
  2077.     } >
  2078.  
  2079. Uedit's About... message
  2080. <shftAltCtl-a:
  2081.     updateDisplay
  2082.     getFilename(buf54,curfile)
  2083.     text(" ",0,0,0,-2)                       .. -2 clear screen using color 0
  2084.     setFileName(curFile,"          About Uedit...")
  2085.     text("           ",3,32,2,0)
  2086.     text("   UEDIT   ",4,32,-1,0)
  2087.     text("           ",5,32,-1,0)
  2088.     text(" Copyright (C) 1986-89, Rick Stiles ",6,19,7,0)
  2089.     text(" P.O. Box  666 ",7,30,-1,0)
  2090.     text(" Washington, IN 47501 ",8,27,-1,0)
  2091.     text("Uedit is SHAREWARE.",11,10,2,0)
  2092.     text("Try it and see how you like it.",13,10,-1,0)
  2093.     text("See ",15,10,-1,0)
  2094.     text("Uedit-Policy",-1,-1,5,0)
  2095.     text(" for ordering information.",-1,-1,2,0)
  2096.     do(n54,8,67) text(" ",1,n54,1,1)
  2097.     do(n54,2,17) text(" ",n54,67,1,1)
  2098.     equateNum(n54,67)
  2099.     while (!eqNum(n54,8)) {
  2100.         text(" ",17,n54,1,1)
  2101.         decNum(n54)
  2102.     }
  2103.     equateNum(n54,17)
  2104.     while (!eqNum(n54,1)) {
  2105.         text(" ",n54,8,1,1)
  2106.         decNum(n54)
  2107.     }
  2108.     getKeyVal(n53,n53)
  2109.     setFileName(curFile,buf54)
  2110.     text(" ",0,0,0,-2)                        .. -2 clear screen in normalVid
  2111.     refreshDisplay >
  2112.  
  2113.                                    *****
  2114.  
  2115. Assign new Primitive Mode terminator Ctrl-key
  2116. <normal-esc:
  2117.     putMsg("Enter new Primitive Mode terminator CTRL-key (pmESC)")
  2118.     if (getChar(n54) & gtNum(32,n54)) equateNum(pmESC,n54)
  2119.     putMsg(" ") >
  2120.  
  2121. Save changed files during idle periods, if their idle-save flag is set
  2122. <idle:
  2123.     getMaxFiles(n52)
  2124.     decNum(n52)
  2125.     do (n54,0,n52) if (!inputWaiting & getflag(buf[n54],changed)
  2126.         & getflag(buf[n54],userLocalA)) saveFile(buf[n54]) >
  2127.  
  2128.                           *** end of Config!M ***
  2129.  
  2130.