home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d07xx / d0770.lha / Uedit / Jenkins.LZH / config!F < prev    next >
Text File  |  1992-01-06  |  26KB  |  755 lines

  1. config!F
  2. ------------------------------------------------------------------------------
  3. Commands for loading, saving, and closing files
  4.  
  5.  
  6. ==== FILE REQUESTER ====
  7.  
  8. ..<alt-z:                Choose from device list or type in directoryPath, get directory listing
  9. ..<virtual-y:            Get listing using dirpath in buf61
  10. ..<virtual-buttonDown:   Mark region clicked with mouse
  11. ..<ctl-buttonDown:       Load file or select directory that is ctl-clicked.
  12.    ..====clicked in dir file, if <REDO> redo listing
  13.    ..====clicked in dir file, if <PARENT> get new listing
  14.    ..====clicked in dir file, if <MAKEDIR> make directory
  15.    ..====clicked in dir file, form dirpath/name
  16. ..<shftCtl-buttonDown:   Rename file or directory that is shftCtl-clicked
  17. ..<altCtl-buttonDown:    Delete file that is altCtl-clicked
  18. ..<virtual-x:            Clicked name to buf62, add to path taken from file name, delete "dir ", show
  19.  
  20.  
  21. ==== FILE OPEN & LOAD ====
  22.  
  23. ..<ctl-f1:               Open "Empty" file
  24. ..<alt-n:                Rename the file in the window
  25. ..<alt-f1:               Load a file
  26. ..<shftAlt-f5:           Convert file to read-only status
  27. ..<shftCtl-f1:           Restore current file to original
  28. ..<shftAlt-f1:           Insert file at cursor
  29. ..<shftAlt-m:            Map illegal ASCII (0 thru 3) characters to safe 128-131
  30.  
  31.  
  32. ==== FILE SAVE & CLOSE ====
  33.  
  34. ..<normal-f2:            Save (ask if not changed) file currently in window 
  35. ..<altCtl-i:             Make icons: Toggle.  When "on", Workbench icons are created
  36. ..<shft-f2:              Save file under different name 
  37. ..<alt-f2:               Save (ask) all changed files
  38. ..<shftCtl-f2:           Save hilite as...  
  39. ..<shftAltCtl-i:         Idle-timer: Enter value (tenths of sec) after which idle command executed
  40. ..<ctl-f2:               Idle: Turn on/off saving changes during idle periods 
  41. ..<idle:                 Save changed files during idle periods, if their idle-save flag is set 
  42. ..<shftAltCtl-f2:        Backup: toggle auto-backup mode 
  43. ..<altCtl-f2:            ReBAK: Save and restore to reset internal backedUp flag
  44. ..<normal-closeBox:      Save (ask) if changed
  45. ..<normal-f3:            Save (ask) if changed
  46. ..<shft-f3:              Save if changed, then close 
  47.  
  48.  
  49. ==== SWITCH, SWAP, SCAN  ====
  50.  
  51. ..<alt-f:                Favorite: toggle
  52. ..<normal-gadget2:       Switch to next favorite document
  53. ..====Switch to next file via normal-gadget1 and shft-gadget1 are in config!E
  54. ..<normal-f1:            Switch to next buffer with a file
  55. ..<shft-f1:              Switch to previous buffer with a file
  56. ..<ctl-w:                Swap the current file with file in buffer 41 
  57. ..<alt-w:                Swap current file to buffer 0 (the "home" buffer of Uedit) 
  58. ..<shftAlt-f6:           Type in the number of a buffer to edit
  59. ..<shftCtl-f6:           Examine all buffers that aren't empty
  60.  
  61.  
  62. ==== QUIT ====
  63.  
  64. ..<normal-f4:            Quit: Save changed (ask), see stacks (ask), see profile (ask), quit (ask)
  65.  
  66. -----------------------------------------------------------------------------
  67. GLOBAL
  68. buf34    (GLOBAL) last dirpath entered from keyboard
  69. buf41    (GLOBAL) swap buffer ctl-w
  70.  
  71. n58      (GLOBAL) buffer # containing directory listing
  72.  
  73. LOCAL
  74. buf61    (LOCAL ) "Dir" + dirpath
  75. buf62    (LOCAL ) path/name
  76. buf63    (LOCAL ) filename
  77.  
  78. buf0
  79. buf43    (LOCAL ) scratch (document names)
  80. buf54    (LOCAL ) scratch
  81. buf61    (LOCAL ) dir dirpath
  82. buf62    (LOCAL ) scratch
  83. buf63    (LOCAL ) scratch
  84. buf64    (LOCAL ) scratch
  85. buf[n0]  (LOCAL ) scan buf
  86. buf[n54] (LOCAL ) scan changed
  87. buf[n58] (LOCAL ) buf with dir listing
  88. n0       (LOCAL ) scratch
  89. n1       (LOCAL ) scratch
  90. n2       (LOCAL ) scratch
  91. n3       (LOCAL ) scratch
  92. n4       (LOCAL ) scratch
  93. n5       (LOCAL ) scratch
  94. n26      (GLOBAL) session profile
  95. n10      (LOCAL ) scratch
  96. n11      (LOCAL ) scratch
  97. n12      (LOCAL ) scratch
  98. n13      (LOCAL ) scratch
  99. n14      (LOCAL ) scratch
  100. ------------------------------------------------------------------------------
  101.  
  102. ==== FILE REQUESTER ====
  103.  
  104. Choose from device list or type in directoryPath, get directory listing
  105. <alt-z:
  106.    ..put dirPath in buf61
  107.    equateNum(n0,curFile)
  108.    text(" ",0,0,0,-2)
  109.    text("Type in directoryPath",1,1,0,0)
  110.    text("DF0:",2,1,0,0)
  111.    text("DF1:",3,1,0,0)
  112.    text("DF2:",4,1,0,0)
  113.    text("SYS:",5,1,0,0)
  114.    text("SYS:s",6,1,0,0)
  115.    text("SYS:s/env",7,1,0,0)
  116.    text("SYS:dev:",8,1,0,0)
  117.    text("TOOLS:",9,1,0,0)
  118.    text("Files:",10,1,0,0)
  119.    text("Uedit",11,1,0,0)
  120.    text("Uedit/EasyWriter_2.6",12,1,0,0)
  121.    text("Uedit/EasyWriter_2.7",13,1,0,0)
  122.    text("Uedit/Commands",14,1,0,0)
  123.    text("Uedit/Stacks",15,1,0,0)
  124.    text("Uedit/StdConfigs",16,1,0,0)
  125.    putMsg("ESC to abort.  Ctl-leftMouse or leftMouse on device to list.")
  126.    freeBuf(buf61)
  127.    getKey(macroNum)
  128.    switch(macroNum) {
  129.       case(normal-buttonDown)
  130.       case(ctl-buttonDown) {
  131.          mouseXY(n3,n4)                                                ..pixels
  132.          div(n4,n4,8)                                                ..raw rows
  133.          sub(n4,n4,1)                                             ..screen rows
  134.          ..putMsg(n4) alertUser("clicked on this row")..debug
  135.          switch(n4) {
  136.             case(1) {
  137.                getKey(inputChar)
  138.                putMsg("Type in directory path: ")
  139. ..               if (isEmpty(buf34)) insertRgn(buf34,sFile,"Files:",all)
  140.                moveCursor(buf34,eFile)
  141.                inputString(buf34)
  142.                freeBuf(buf61)
  143.                insertRgn(buf61,sFile,buf34,all)
  144.                insertRgn(buf61,sFile,"Dir ",all) 
  145.                runKey(virtual-y) 
  146.                returnTrue }
  147.             case(2) {insertRgn(buf61,eFile,"DF0:",all) }
  148.             case(3) {insertRgn(buf61,eFile,"DF1:",all) }
  149.             case(4) {insertRgn(buf61,eFile,"DF2:",all) }
  150.             case(5) {insertRgn(buf61,eFile,"SYS:",all) }
  151.             case(6) {insertRgn(buf61,eFile,"SYS:s",all) }
  152.             case(7) {insertRgn(buf61,eFile,"SYS:s/env",all) }
  153.             case(8) {insertRgn(buf61,eFile,"SYS:devs",all) }
  154.             case(9) {insertRgn(buf61,eFile,"TOOLS:",all) }
  155.             case(10) {insertRgn(buf61,eFile,":",all) }
  156.             case(11) {insertRgn(buf61,eFile,"Uedit",all) }
  157.             case(12) {insertRgn(buf61,eFile,"Uedit/EasyWriter_2.6",all) }
  158.             case(13) {insertRgn(buf61,eFile,"Uedit/EasyWriter_2.7",all) }
  159.             case(14) {insertRgn(buf61,eFile,"Uedit/Commands",all) }
  160.             case(15) {insertRgn(buf61,eFile,"Uedit/Stacks",all) }
  161.             case(16) {insertRgn(buf61,eFile,"Uedit/StdConfigs",all) } }
  162.          insertRgn(buf61,sFile,"Dir ",all) 
  163.          runKey(virtual-y) 
  164.          returnTrue }
  165.       case(normal-esc)
  166.       default {
  167.          editBuf(buf[n0])
  168.          putMsg("File directory aborted")
  169.          refreshDisplay
  170.          returnFalse } }
  171.    >Friday 02-Aug-91 22:06:30
  172.  
  173. Get listing using dirpath in buf61
  174. <virtual-y:
  175.    newFile
  176.    equateNum(n58,curFile)            ..record buf# containing directory listing
  177.    setFileName(curFile,buf61)
  178.    if (!execute(curFile,buf61)) {
  179.       putMsg("Dir request failed") returnFalse }
  180.    moveCursor(curFile,sFile)
  181.    insertChar(curFile,eLine)
  182.    insertRgn(curFile,sFile,buf61,all)
  183.    moveCursor(curFile,sFile)
  184.    insertChar(curFile,eLine)
  185.    insertChar(curFile,eLine)
  186.    insertRgn(curFile,sFile,"  DELETE=AC-mouse",all)
  187.    insertRgn(curFile,sFile,"  RENAME=SC-mouse",all)
  188.    insertRgn(curFile,sFile,"  LOAD=C-mouse",all)
  189.    insertRgn(curFile,sFile,"<REDO> <PARENT> <MAKEDIR>",all)
  190.    vScroll(sFile)
  191.    putMsg("To load files, ctrl-click names with mouse.")
  192.    flipFlag(curFile,changed) 
  193.    >Tuesday 18-Dec-90 21:52:53
  194.  
  195. Mark region clicked with mouse
  196. <virtual-buttonDown:
  197.    while (mouseDown) putMsg("Enough...leggo the button")
  198.    putMsg(" ")
  199.    equateLoc(curFile,atCursor,mouseLoc)
  200.    equateLoc(curFile,eInvert,atCursor)
  201.    equateLoc(curFile,sInvert,atCursor)
  202.    while (mouseDown) inputKey(n14)
  203.    
  204.    if (is(curFile,eFile) | is(curFile,whiteSpace)) returnFalse
  205.    
  206.    ..find start of non-white
  207.    while (!is(curFile,whiteSpace) & !is(curFile,sFile))
  208.        moveCursor(curFile,sChar)
  209.    if (is(curFile,whiteSpace)) moveCursor(curFile,eChar)
  210.    equateLoc(curFile,sInvert,atCursor)
  211.    
  212.    ..find end of non-white
  213.    while (!is(curFile,whiteSpace) & !is(curFile,eFile))
  214.        moveCursor(curFile,eChar)
  215.    equateLoc(curFile,eInvert,atCursor)            .. einvert = end non-white
  216.    refreshDisplay
  217.    >Saturday 20-Jul-91 20:33:37
  218.  
  219. Load file or select directory that is ctl-clicked.
  220. <ctl-buttonDown:
  221.    if (!runKey(virtual-buttonDown)) {                 ..clicked on white or eFile
  222.       ..go to dir file or open dir
  223.       if (!getFileName(buf63,buf[n58])) {                     ..is dir list open?
  224.          ..alertUser("dir listing is not open")..debug
  225.          while (mouseDown) nothing
  226.          runKey(alt-z) return }
  227.       ..n58 might be corrupt, check file name for "dir "
  228.       moveCursor(buf63,eFile)
  229.       setSearch("Dir ") 
  230.       if (!search(buf63,sHilite,eHilite,-1)) {
  231.          ..alertUser("buf[n58] is open but is not dir listing")..debug
  232.          runKey(alt-z) return }
  233.       else {
  234.          editBuf(buf[n58])               ..go to dir listing
  235.          putMsg("CTRL-Click on file or directory name") return  
  236.          return } }
  237.  
  238.    ..swallow buttonUp?
  239.    while (inputWaiting) inputKey(n0)
  240.  
  241.    ..====clicked in dir file, if <REDO> redo listing
  242.    freeBuf(buf63)
  243.    insertRgn(buf63,sFile,curFile,invert)
  244.    ..editBuf(buf63) alertUser("clicked word, in <REDO>")..debug
  245.    setSearch("<REDO>")
  246.    if (search(buf63,sHilite,eHilite,-1)) {
  247.       ..alertUser("<REDO>")..debug
  248.       freeBuf(buf61)
  249.       getFileName(buf61,curFile)
  250.       equateNum(n0,curFile)
  251.       runKey(virtual-y) ..get listing
  252.       freeBuf(buf[n0])
  253.       return }
  254.       
  255.    ..====clicked in dir file, if <PARENT> get new listing
  256.    ..editBuf(buf63) alertUser("clicked word, in <PARENT>")..debug
  257.    setSearch("<PARENT>")
  258.    if (search(buf63,sHilite,eHilite,-1)) {
  259.       ..alertUser("<PARENT>")..debug
  260.       freeBuf(buf61)
  261.       getFileName(buf61,curFile)
  262.       moveCursor(buf61,eFile) moveCursor(buf61,sChar)
  263.       if(is(buf61,":")) { 
  264.          putMsg("In root directory") 
  265.          return }
  266.       setSearch(":$/")
  267.       moveCursor(buf61,eFile)
  268.       if (!search(buf61,sHilite,sHilite,-1)) {
  269.          putMsg("ILLEGAL path") 
  270.          return }
  271.       ..editBuf(buf61) alertUser("found :$/ in filename")..debug
  272.       if (is(buf61,":")) {  ..move off : so as to not delete
  273.          moveCursor(buf61,eChar) 
  274.          equateLoc(buf61,sHilite,atCursor) }
  275.       equateLoc(buf61,eHilite,eFile)
  276.       ..editBuf(buf61) alertUser("dir to delete")..debug
  277.       clearRgn(buf61,hilite)
  278.       ..putMsg(buf61) alertUser("parent path")..debug
  279.       equatenum(n0,curFile)
  280.       runKey(virtual-y) ..get listing
  281.       freeBuf(buf[n0])
  282.       return }
  283.  
  284.    ..====clicked in dir file, if <MAKEDIR> make directory
  285.    ..editBuf(buf63) alertUser("clicked word, in <MAKEDIR>")..debug
  286.    setSearch("<MAKEDIR>")
  287.    if (search(buf63,sHilite,eHilite,-1)) {
  288.       ..alertUser("<MAKEDIR>")..debug
  289.       freeBuf(buf61)
  290.       getFileName(buf61,curFile)
  291.       moveCursor(buf61,eFile)
  292.       moveCursor(buf61,sChar)
  293.       if (!is(buf61,":")) {moveCursor(buf61,eChar) insertChar(buf61,"/") }
  294.       freeBuf(buf43)
  295.       putMsg("Type in directory:")
  296.       if (inputString(buf43)) {
  297.          insertRgn(buf61,eFile,buf43,all)
  298.          moveCursor(buf61,sFile) do(n0,1,4) clearChar(buf61)
  299.          insertRgn(buf61,sFile,"MAKEDIR ",all)
  300.          ..putMsg(buf61) alertUser("Command")..debug
  301.          execute (" ",buf61)
  302.          putMsg("Made directory") }
  303.       return }
  304.    
  305.    ..====clicked in dir file, form dirpath/name
  306.    freeBuf(buf62)
  307.    getFileName(buf62,curFile)
  308.    moveCursor(buf62,eFile)
  309.    moveCursor(buf62,sChar)
  310.    if(!is(buf62,":")) { moveCursor(buf62,eChar) insertChar(buf62,"/") }
  311.    insertRgn(buf62,eFile,curFile,invert)
  312.    ..putMsg(buf62) alertUser("formed path/name")..debug
  313.    
  314.    ..if dirname (followed by (dir)) get listing
  315.    getPageRowCol(n0,n1,n2)
  316.    moveCursor(curFile,eWord)
  317.    moveCursor(curFile,eChar)
  318.    equateLoc(curfile,eHilite,atCursor)
  319.    moveCursor(curFile,sWord)
  320.    moveCursor(curFile,sChar)
  321.    equateLoc(curFile,sHilite,atCursor)
  322.    getPageRowCol(n3,n4,n5)
  323.    if (eqNum(n1,n4)) {                            ..on same row as clicked word
  324.       freeBuf(buf63)
  325.       insertRgn(buf63,sFile,curFile,hilite) equateLoc(curFile,sHilite,eHilite) 
  326.       setSearch("(dir)")
  327.       if (search(buf63,sHilite,eHilite,-1)) {              ..clicked on dirname
  328.          ..putMsg(buf62) alertUser("about to free and get new dir")..debug
  329.          freeBuf(curFile)
  330.          freeBuf(buf61)
  331.          insertRgn(buf61,sFile,buf62,all)
  332.          runKey(virtual-y) ..get listing
  333.          return } }
  334.    
  335.    ..was filename, load file
  336.    moveCursor(buf62,sFile) do(n0,1,4) clearChar(buf62)
  337.    ..putMsg(buf62) alertUser("about to load file")..debug
  338.    if (loadFile(buf62)) {
  339.       if (isEmpty(curFile)) 
  340.          if (askYesNo("FILE NOT FOUND.... Close this empty buffer?")) {
  341.          freeBuf(curFile)
  342.          return }
  343.       downFlag(curFile,userLocalA)                           ..cancel = no save
  344.       downFlag(curFile,autoBackup)                         ..cancel = no backup
  345.       if (askYesNo("Set save on idle?")) 
  346.             upFlag(curFile,userLocalA)
  347.          else
  348.             downFlag(curFile,userLocalA)
  349.       if (askYesNo("Set backup?")) 
  350.             upFlag(curFile,autoBackup)
  351.          else
  352.             downFlag(curFile,autoBackup) }
  353.    >Saturday 20-Jul-91 20:31:21
  354.  
  355. Rename file or directory that is shftCtl-clicked
  356. <shftCtl-buttonDown:
  357.    runKey(virtual-x)  ..form path/name in buf62
  358.    freeBuf(buf64)
  359.    insertRgn(buf64,sFile,buf62,all)
  360.    insertChar(buf64," ")
  361.    insertRgn(buf64,sFile,"RENAME ",all)
  362.    putMsg("Change path/name:")
  363.    moveCursor(buf62,eFile)
  364.    if (!inputString(buf62)) { putMsg("File NOT renamed") return }
  365.    insertRgn(buf64,eFile,buf62,all)
  366.    ..putMsg(buf64) alertUser("command formed")..debug
  367.    if (execute(" ",buf64)) putMsg("Dir or File renamed or moved")
  368.    >Saturday 20-Jul-91 19:22:45
  369.  
  370. Delete file that is altCtl-clicked
  371. <altCtl-buttonDown:
  372.    runKey(virtual-x)  ..form path/name in buf62
  373.    if (askYesNo("    DELETE....file or directory shown above?")) {
  374.       if (askYesNo("  ARE YOU SURE YOU WANT TO DELETE IT?  ")) {
  375.             insertRgn(buf62,sFile,"DELETE ",all)
  376.             ..putMsg(buf62) alertUser("delete command")..debug
  377.             if (execute(" ",buf62)) putMsg("File deleted") }
  378.          else {
  379.             putMsg("File NOT deleted")
  380.             return } } 
  381.    >Tuesday 18-Dec-90 22:11:30
  382.  
  383. Clicked name to buf62, add to path taken from file name, delete "dir ", show
  384. <virtual-x:
  385.    runKey(virtual-buttonDown)
  386.       ..if not in dir file go to dir file or get dir
  387.       if (!runKey(virtual-buttonDown)) {                ..clicked on white or eFile 
  388.          if (!eqNum(curFile,n58)) {                         ..not in dir listing buf
  389.             if (!isEmpty(buf[n58]))
  390.                   editBuf(buf[n58]) return                       ..go to dir listing
  391.                else
  392.                   runKey(alt-z) }                      ..no dir listing open, make one
  393.             else {
  394.                putMsg("Click on name of file to erase or rename") return }
  395.       }
  396.       freeBuf(buf62)
  397.       getFileName(buf62,curFile)
  398.       moveCursor(buf62,eFile)
  399.       moveCursor(buf62,sChar)
  400.       if(!is(buf62,":")) { moveCursor(buf62,eChar) insertChar(buf62,"/") }
  401.       insertRgn(buf62,eFile,curFile,invert)
  402.       moveCursor(buf62,sFile) do(n0,1,4) clearChar(buf62)
  403.       putMsg(buf62) 
  404.       >Saturday 15-Dec-90 12:58:41
  405.  
  406. ==== FILE OPEN & LOAD ====
  407.  
  408. Open "Empty" file
  409. <ctl-f1: 
  410.    newFile
  411.    downFlag(curFile,userLocalA)
  412.    downFlag(curFile,autoBackup)
  413.    if (askYesNo("Set save on idle?")) 
  414.          upFlag(curFile,userLocalA)
  415.       else
  416.          downFlag(curFile,userLocalA)
  417.    if (askYesNo("Set backup?")) 
  418.          upFlag(curFile,autoBackup)
  419.       else
  420.          downFlag(curFile,autoBackup)
  421.    >Saturday 13-Jul-91 20:36:44
  422.  
  423. Rename the file in the window
  424. <alt-n:
  425.    putMsg("Revise pathName:")
  426.    getFileName(buf43,curFile)
  427.    moveCursor(buf43,eFile)
  428.    if (inputString(buf43))
  429.    setFileName(curFile,buf43) 
  430.    >Sunday 21-Jul-91 13:10:27
  431.  
  432. Load a file
  433. <alt-f1:
  434.    putMsg("Type pathName:")
  435.    freeBuf(buf43)
  436.    if (inputString(buf43)) loadFile(buf43)
  437.    if (isEmpty(curFile)) 
  438.       if (askYesNo("FILE NOT FOUND.... Close this empty buffer?")) freeBuf(curFile)
  439.    if (askYesNo("Set save on idle?")) 
  440.          upFlag(curFile,userLocalA)
  441.       else
  442.          downFlag(curFile,userLocalA)
  443.    if (askYesNo("Set backup?")) 
  444.          upFlag(curFile,autoBackup)
  445.       else
  446.          downFlag(curFile,autoBackup)
  447.    >Sunday 07-Jul-91 18:57:51
  448.  
  449. Convert file to read-only status
  450. <shftAlt-f5:
  451.    flipFlag(curFile,readOnly)
  452.    if (getFlag(curFile,readOnly))
  453.          putMsg("Now READ ONLY")
  454.       else
  455.          putMsg("Now editable")
  456.    >Saturday 08-Jun-91 20:34:03
  457.  
  458. Restore current file to original
  459. <shftCtl-f1:
  460.    if (!askYesNo("Restore file to original?")) returnFalse
  461.    if (getFileName(buf43,curFile)) { freeBuf(curFile) loadFile(buf43) } 
  462.    if (askYesNo("Set save on idle?")) 
  463.          upFlag(curFile,userLocalA)
  464.       else
  465.          downFlag(curFile,userLocalA)
  466.    if (askYesNo("Set backup?")) 
  467.          upFlag(curFile,autoBackup)
  468.       else
  469.          downFlag(curFile,autoBackup)
  470.    >Sunday 07-Jul-91 18:57:53
  471.  
  472. Insert file at cursor
  473. <shftAlt-f1:
  474.    putMsg("Type pathNme to insert:")
  475.    freeBuf(buf43)
  476.    if (inputString(buf43)) insertFile(curFile,atCursor,buf43) 
  477.    >Sunday 07-Jul-91 18:57:54
  478.  
  479. ..
  480. .. default 0-3 -> 128-131 See top of Config!
  481. ..
  482. Map illegal ASCII (0 thru 3) characters to safe 128-131
  483. <shftAlt-m: 
  484.    flipFlag(curFile,mapChars)
  485.    >Monday 10-Jun-91 19:07:03
  486.  
  487.  
  488.  
  489. ==== FILE SAVE & CLOSE ====
  490.  
  491. Save (ask if not changed) file currently in window 
  492. <normal-f2: 
  493.    if (!getFlag(curFile,changed)) {
  494.       if (!askYesNo("NOT changed, save anyway?")) return }
  495.    saveFile(curFile)
  496.    >Friday 14-Dec-90 13:37:27
  497.  
  498. Make icons: Toggle.  When "on", Workbench icons are created
  499. <altCtl-i: 
  500.    flipFlag(curFile,icons)
  501.    if (getFlag(curFile,icons))
  502.          putMsg("Making icons")
  503.       else
  504.          putMsg("NOT Making icons")
  505.    >Monday 10-Jun-91 19:11:04
  506.  
  507. Save file under different name 
  508. <shft-f2:
  509.    putMsg("Save file as:")  ..freeBuf(buf43) 
  510.    getFileName(buf43,curFile) 
  511.    if (inputString(buf43) & setFileName(curFile,buf43))
  512.       saveFile(curFile) 
  513.    >Wednesday 12-Dec-90 23:43:18
  514.  
  515. Save (ask) all changed files
  516. <alt-f2:
  517.    equateNum(n0,curFile)
  518.    getMaxFiles(n2)
  519.    decNum(n2)
  520.    putMsg("NO changed files")
  521.    do (n4,0,n2)
  522.       if (getFlag(buf[n4],changed)) { 
  523.          editBuf(buf[n4])
  524.          putMsg(" ")
  525.          if(askYesNo("CHANGED...Save it?")) saveFile(buf[n4]) }
  526.    ..might have swapped into buf41
  527.    if (getFlag(buf41,changed)) { 
  528.       editBuf(buf41)
  529.       putMsg(" ")
  530.       if(askYesNo("CHANGED...Save it?")) saveFile(buf41) }
  531.    editBuf(buf[n0])
  532.    >Tuesday 30-Jul-91 16:21:48
  533.  
  534. Save hilite as...  
  535. <shftCtl-f2:
  536.    freeBuf(buf43) 
  537.    insertRgn(buf43,sFile,buf34,all)
  538.    moveCursor(buf43,sChar)
  539.    if (!is(buf43,":")) {
  540.       moveCursor(buf43,eChar)
  541.       insertChar(buf43,"/") }
  542.    moveCursor(buf43,eFile)
  543.    putMsg("Save hilite as:")  
  544.    if (!inputString(buf43)) return 
  545.    freeBuf(buf54)
  546.    insertRgn(buf54,efile,curFile,hilite) 
  547.    setFileName(buf54,buf43)
  548.    saveFile(buf54) freeBuf(buf54) 
  549.    >Saturday 06-Jul-91 16:04:25
  550.  
  551. Idle-timer: Enter value (tenths of sec) after which idle command executed
  552. <shftAltCtl-i:
  553.    putMsg("Type in idle time (tenths of a second)")
  554.    if (inputNum(n14)) equateNum(idleTime,n14)
  555.    >Monday 24-Dec-90 18:58:02
  556.  
  557. Idle: Turn on/off saving changes during idle periods 
  558. <ctl-f2: 
  559.    flipFlag(curFile,userLocalA) 
  560.    >Wednesday 12-Dec-90 23:43:19
  561.  
  562. Save changed files during idle periods, if their idle-save flag is set 
  563. <idle:
  564.    getMaxFiles(n12) 
  565.    decNum(n12) 
  566.    do (n14,0,n12) {
  567.       if (!inputWaiting 
  568.           & getflag(buf[n14],changed) 
  569.           & getflag(buf[n14],userLocalA)) {
  570.              incNum(n26)                                                ..profile
  571.              saveFile(buf[n14]) }
  572.       ..may have switched changed file to buf41 without pause
  573.       if (!inputWaiting 
  574.           & getflag(buf41,changed) 
  575.           & getflag(buf41,userLocalA)) {
  576.              incNum(n26)                                                ..profile
  577.              saveFile(buf41) } }
  578.    >Friday 05-Jul-91 15:34:51
  579.  
  580. Backup: toggle auto-backup mode 
  581. <shftAltCtl-f2: 
  582.    flipFlag(curFile,autoBackup) 
  583.    >Tuesday 18-Dec-90 12:38:46
  584.  
  585. ReBAK: Save and restore to reset internal backedUp flag
  586. <altCtl-f2:
  587.    if (!getFlag(curFile,autoBackup))
  588.          putMsg("Backups not requested.  NO ACTION TAKEN.")
  589.       else {
  590.          runKey(normal-f2)
  591.          runKey(shftCtl-f1) }
  592.    >Thursday 20-Dec-90 21:40:27
  593.  
  594. Save (ask) if changed
  595. <normal-closeBox:
  596.    if (getFlag(curfile,changed) &
  597.        askYesNo("Save changes?") &
  598.            !saveFile(curFile)) return
  599.    freeBuf(curFile)
  600.    if (isEmpty(curFile)) {
  601.        equateNum(n1,0)
  602.        getMaxFiles(n2)
  603.        decNum(n2)
  604.        do (n0,0,n2) if (!isEmpty(buf[n0])) equatenum(n1,1)
  605.        if (eqNum(n1,0) & askYesNo("Really quit?")) quit(0)
  606.    } 
  607.    >Wednesday 12-Dec-90 23:43:20
  608.  
  609. Save (ask) if changed
  610. <normal-f3:
  611.    if (!isEmpty(curFile)
  612.        & getFlag(curFile,changed) 
  613.        & askYesNo("Save changes before closing?")
  614.        & !saveFile(curFile)) returnFalse
  615.           freeBuf(curFile) 
  616.    >Wednesday 01-May-91 21:40:39
  617.  
  618. Save if changed, then close 
  619. <shft-f3:
  620.    if (getFlag(curFile,changed)) {
  621.          if (saveFile(curFile)) {
  622.             freeBuf(curFile)
  623.             delay (1) ..prevent msg from being erased
  624.             putMsg("That file was saved and closed") } }
  625.       else {
  626.          freeBuf(curFile) 
  627.          delay (1)
  628.          putMsg("That file was not changed, so not saved, just closed") }
  629.     
  630.    >Wednesday 01-May-91 21:49:35
  631.  
  632. ==== SWITCH, SWAP, SCAN  ====
  633.  
  634. Favorite: toggle
  635. <alt-f: 
  636.    flipFlag(curFile,favorite)
  637.    
  638.    if (getFlag(curFile,favorite))
  639.          putMsg("Now favorite")
  640.       else
  641.          putMsg("Now NOT favorite")
  642.    >Thursday 11-Jul-91 12:05:42
  643.  
  644. Switch to next favorite document
  645. <normal-gadget2: 
  646.    if (!toggle(favorite))
  647.       if (getFlag(curFile,favorite))
  648.             putMsg("Only favorite")
  649.          else
  650.             putMsg("No favorite")
  651.    >Friday 14-Dec-90 19:32:52
  652.  
  653. ..====Switch to next file via normal-gadget1 and shft-gadget1 are in config!E
  654.  
  655. Switch to next buffer with a file
  656. <normal-f1: 
  657.    if (!toggle(curFile)) { putMsg("No other files") returnFalse }
  658.    >Wednesday 12-Dec-90 23:43:20
  659.  
  660. Switch to previous buffer with a file
  661. <shft-f1:
  662.    getMaxFiles(n1)
  663.    if (geNum(1,n1)) {
  664.       editBuf(buf0) 
  665.       putMsg("maxFiles =1") 
  666.       returnFalse }
  667.    decNum(n1)
  668.    equateNum(n0,curFile)
  669.    ..if curFile is a buffer start with maxFiles-1
  670.    if (gtNum(n0,n1)) equateNum(n0,n1)
  671.    LABEL(0)
  672.       decNum(n0)  ..go back one
  673.       ..if now at neg buffer number, go to maxFiles-1
  674.       if (gtNum(0,n0)) equateNum(n0,n1)
  675.       ..if file exists (trick), see it, else loop
  676.       if (getFileName(buf50,buf[n0])) {
  677.          editBuf(buf[n0]) returnTrue }
  678.       goto label(0)
  679.    >Thursday 11-Jul-91 12:49:07
  680.  
  681. Swap the current file with file in buffer 41 
  682. <ctl-w: 
  683.    swapBuf(curFile,buf41) 
  684.    >Wednesday 12-Dec-90 23:43:21
  685.  
  686. Swap current file to buffer 0 (the "home" buffer of Uedit) 
  687. <alt-w:
  688.    swapBuf(buf0,curFile) 
  689.    editBuf(buf0)
  690.    >Wednesday 12-Dec-90 23:43:21
  691.  
  692. Type in the number of a buffer to edit
  693. <shftAlt-f6:
  694.    putMsg("Type in number of buffer to edit:")
  695.    if (inputNum(n14)) {
  696.       editBuf(buf[n14]) 
  697.       vScroll(sFile) } 
  698.    >Friday 19-Jul-91 22:36:54
  699.  
  700. Examine all buffers that aren't empty
  701. <shftCtl-f6:
  702.    getMaxFiles(n12)
  703.    do (n14,n12,99) if (!isEmpty(buf[n14])) {
  704.       editBuf(buf[n14])
  705.       vScroll(sFile)
  706.       updateDisplay
  707.       putMsg("F1=continue, F2=edit this one, F3=stop:")
  708.       getKey(n13)
  709.       if (eqNum(n13,normal-f2)) { putMsg(" ") return }
  710.       if (eqNum(n13,normal-f3)) goto label(1) }
  711.    label(1)
  712.    toggle(curFile)
  713.    putMsg(" ") 
  714.    >Thursday 13-Dec-90 16:15:12
  715.  
  716. ==== QUIT ====
  717.  
  718. Quit: Save changed (ask), see stacks (ask), see profile (ask), quit (ask)
  719. <normal-f4:
  720.    getMaxFiles(n12)
  721.    if (eqNum(n12,1) & isEmpty(curFile)) quit(0)
  722.    decNum(n12)
  723.    do(n14,0,n12) if (!isEmpty(buf[n14])) goto label(0)
  724.    if (!isEmpty(buf41)) goto label(0)
  725.    quit(0)  ..all buffers are empty.
  726.    LABEL(0)
  727.    equateNum(n13,0)
  728.    do(n14,0,n12) 
  729.       if (!isEmpty(buf[n14]) & getFlag(buf[n14],changed)) equateNum(n13,1)
  730.    ..might have swapped into buf41
  731.    if (!isEmpty(buf[n14]) & getFlag(buf41,changed)) equateNum(n13,1)                         
  732.    if (eqNum(n13,1) & askYesNo("Save any changed files before quitting?"))
  733.       runKey(alt-f2)
  734.    equateNum(n0,49)                                         ..copy cut buffer A
  735.    equateNum(n1,0)                                    ..n1=number stack to test
  736.    getStacKSize(n0,n1,n2)
  737.    if (gtNum(n0,0)) {
  738.       if (askYesNo("Do you want to examine copy cut stack?")) {
  739.          do(n5,1,n0) {
  740.             newFile
  741.             equateNum(n5,curFile)
  742.             setFileName(curFile,"Copy_Cut_Stack")
  743.             pop(buf47,curFile)
  744.             editBuf(buf[n5])
  745.             moveCursor(curFile,sFile)
  746.             putMsg("d=discard this file, k=keep and look for more")
  747.             getKeyVal(macroNum,inputChar)
  748.             switch(macroNum) {
  749.                case("d") {freeBuf(curFile) }
  750.                default {nothing} } } } }
  751.    if (askYesNo("Show session profile before quitting?")) runKey(shftAltCtl-f1)
  752.    if (askYesNo("Quit now?")) quit(0)
  753.    >Thursday 11-Jul-91 22:48:10
  754.    
  755.