home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d189 / uedit.lha / Uedit / Config!M < prev    next >
Text File  |  1989-03-11  |  70KB  |  1,995 lines

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