home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d7xx
/
d770
/
uedit.lha
/
Uedit
/
edt.LZH
/
edt!m
< prev
Wrap
Text File
|
1992-03-04
|
19KB
|
653 lines
------------------------- miscellaneous keys -------------------------------
Search & Replace
<virtual-s:
freeBuf(buf49)
putMsg("Search for:")
inputString(buf49)
freebuf(buf48)
putMsg("Replace with:")
inputString(buf48)
runKey(normal-f9)
while (not eqLoc(curFile,sInvert,eInvert))
{if (askYesNo("Replace? "))
{clearRgn(curFile,invert)
insertRgn(curFile,sInvert,buf48,all)
}
runKey(normal-f9)
}
>
<shftaltctl-z:
loadFile("U:EDTini!")
while (compile(curFile)) putMsg("Compiling initialization file...")
freeBuf(curFile)
>
Place cursor or scroll if button held
<normal-buttonDown:
moveCursor(curFile,mouseLoc)
refreshDisplay
runKey(virtual-\)
>
Arrow Keys
Scroll up 1 line
<normal-upArrow:
moveCursor(curFile,upLine)
runKey(virtual-\)
>
Scroll down 1 line
<normal-downArrow:
moveCursor(curFile,downLine)
runKey(virtual-\)
>
Scroll right 1 char
<normal-leftArrow:
moveCursor(curFile,sChar)
runKey(virtual-\)
>
Scroll left 1 char
<normal-rightArrow:
moveCursor(curFile,eChar)
runKey(virtual-\)
>
Set mark in the current file
<alt-`:
locToLine(curFile,n94,atCursor)
locToCol(curFile,n95,atCursor)
putMsg("Mark set.")
>
Goto mark
<virtual-`:
putMsg("Going to mark.")
equateNum(n92,n94)
equateNum(n93,n95)
locToLine(curFile,n94,atCursor)
locToCol(curFile,n95,atCursor)
lineToLoc(curFile,atCursor,n92)
colToLoc(curFile,atCursor,n93)
updateDisplay
>
Switch to/from using spaces for tabs or using real tabs
<altCtl-tab: flipFlag(curFile,trueTabs)>
Show tab ruler above cursor line
<shftAlt-tab: seeRuler>
Set tab ruler using mouse or keys
<shftCtl-tab:
putMsg(
"Use mouse click/drag, Tab, Space, BS, Del (anykey=quit,lAmi-Esc=abort)")
setRuler putMsg(" ") >
Convert tabs in document to spaces
<lAmiga-t: tabsToSpaces(curFile)>
Convert spaces in document to TABs
<rAmiga-t: spacesToTabs(curFile) >
Set TAB table number (0-4) to use for TAB spacing
<shftAltCtl-tab:
putMsg("Enter new tab table # (0-4):")
if (inputNum(n54)) if (geNum(n54,0)) if (geNum(4,n54))
{ setLocal(curFile,tabTable,n54) equateNum(tabTable,n54) } >
Split window to show current file
<virtual-=:
if (eqNum(n96,1)) .. %% Window is split already
{equateNum(n96,0)
toggle(windowSplit)
splitWindow(curFile,0)
}
else
{equateNum(n96,1) .. %% Not split, go ahead and split it
if (getFlag(curFile,lace))
splitWindow(curFile,22)
else
splitWindow(curFile,10)
}
>
Switch to next window split
<virtual-upArrow: toggle(windowSplit)>
Switch to next window split
<virtual-downArrow: toggle(windowSplit)>
Increase # lines in active split window by one
<shftalt-.:
equateNum(n54,curFile)
getSplitLines(n53,n52) .. get start & stop
sub(n52,n52,n53)
incNum(n52) .. bump # lines
splitWindow(curFile,0)
if (not splitWindow(buf[n54],n52)) {
decNum(n52) .. decrement it back
splitWindow(buf[n54],n52)
returnFalse
} >
Decrease # lines in active split window by one
<shftalt-,:
equateNum(n54,curFile)
getSplitLines(n53,n52)
decNum(n52)
sub(n52,n52,n53)
if (gtNum(2,n52)) returnFalse
splitWindow(curFile,0)
splitWindow(buf[n54],n52)
>
Toggle "busies" setting - when turned on, it shows buffers being worked on
<ctl-b: flipFlag(curFile,busies) >
Let next character typed be a CTRL-character, such as formfeed, etc
<ctl-c: putMsg("Input a control character:")
getChar(n54)
if (geNum(31,n54)) goto label(1)
if (geNum(n54,64)) if (geNum(127,n54)) {
label(1)
and(n54,n54,31)
insertChar(curFile,n54)
}
putMsg(" ") >
Change current document's end-of-line character
<ctl-e:
putMsg("Input file's current end-of-line value (usually 10 or 13):")
inputNum(n54)
if (not gtNum(n54,0)) returnFalse
putMsg("Input new end-of-line value (usually 10 or 13):")
inputNum(n53)
if (not gtNum(n53,0)) returnFalse
setEol(n54)
moveCursor(curFile,sFile)
putMsg("Changing eol characters ... hit Amiga-ESC to abort.")
while (moveCursor(curFile,eLine))
if (is(curFile,n54)) swapChar(curFile,n53)
setEol(n53)
vScroll(sFile)
putMsg(" ")
refreshDisplay >
Toggle the mark-gadgets setting. When "off", the gadget names don't show
<ctl-g: flipFlag(curFile,markGadgets) >
Toggle the "make icons" flag. When "on", Workbench icons are created
<altCtl-i: flipFlag(curFile,icons)>
Enter idle-timer value (seconds) after which idle command executed
<shftAltCtl-i: putMsg("Input idle time (seconds)")
if (inputNum(n54)) equateNum(idleTime,n54)>
Toggle the right-justify typing mode
<alt-j: flipFlag(curFile,rightJustify) >
Set command multiplier to use for next command
<ctl-m: putMsg("Input command multiplier:") inputNum(cmdMultiplier) >
Map illegal ASCII (0 thru 5) characters into safe ones. (See top of Config!)
<shftAlt-m: flipFlag(curFile,mapChars)>
Input a text line number to go to
<virtual-n: putMsg("Input line number:")
if (inputNum(n54))
{ lineToLoc(curFile,atCursor,n54) vScroll(atCursor) } >
Terminate Learn Mode or run whatever is stored in learn-buffer. (See ctl-s.)
<ctl-r: runLearn >
Start/abort Learn Mode. (Use ctl-r to finish & to run it.)
<ctl-s: if (not getFlag(curFile,learnMode)) putMsg("LEARN MODE ACTIVE!")
else putMsg("Learn Mode cancelled.")
flipFlag(curFile,learnMode) >
Show key-help message on next key pressed. Copy key-help to RAM: on first
<ctl-t: putMsg("Input a key, gadget, click etc to get Help msg")
getKey(n54)
teachOne(n54)>
Toggle between using printable keys for commands or for normal typing input
<alt-u: flipFlag(curFile,useKeys)>
Delete to beginning of line
<ctl-u:
freeBuf(buf45)
equateLoc(curFile,locB,atCursor)
if (is(curFile,sLine)) return
moveCursor(curFile,sLine)
equateLoc(curFile,locA,atCursor)
insertRgn(buf45,sFile,curFile,loc)
clearRgn(curFile,loc)
>
Set left margin
<shftaltctl-l: putMsg("Enter left margin column (0-200):")
if (inputNum(n54)) equateNum(leftMargin,n54)
setLocal(curFile,leftMargin,leftMargin)>
Set right margin
<shftaltctl-r:
putMsg("Enter right margin column (1-200):")
if (inputNum(n54))
{sub(n54,n54,leftMargin)
setLocal(curFile,lineLength,n54)
equateNum(lineLength,n54)
}
>
Switch flag that makes CTRL chars vis/invis
<ctl-v: flipFlag(curFile,spooks) refreshDisplay >
Execute an AmigaDOS command, but don't collect the results
<lAmiga-y: putMsg("Enter AmigaDOS command")
freeBuf(buf40)
if (inputString(buf40)) execute(" ",buf40) >
Execute an AmigaDOS command and show the results
<lAmiga-z: putMsg("Enter AmigaDOS command")
freeBuf(buf40)
if (not inputString(buf40)) returnFalse
freeBuf(buf39)
if (not execute(buf39,buf40)) returnFalse
if (not isEmpty(buf39))
{ putMsg("Result of AmigaDOS command:")
flipFlag(buf39,changed)
editBuf(buf39)
vscroll(sFile)
updateDisplay
} else
{ putMsg("No message from AmigaDOS.") freeBuf(buf39) } >
Change the current working directory
<lAmiga-c: putMsg("Change current directory to (won't work in Workbench):")
freeBuf(buf54)
if (inputString(buf54)) changeDir(buf54)>
Center text in the line. (Uses current line length.)
<alt-c:
runKey(alt-1) .. clear leading white space
if (is(curFile,blankLine)) returnFalse
if (not is(curFile,eLine)) moveCursor(curFile,eLine)
locToCol(curFile,n53,atCursor)
equateNum(n54,lineLength)
incNum(n54)
if (gtNum(n54,n53)) {
moveCursor(curFile,sLine)
sub(n53,n54,n53)
div(n53,n53,2)
do (n54,2,n53) insertChar(curFile," ")
} >
Right-align the cursor line from cursor rightward
<alt-5: runKey(alt-6)
locToCol(curFile,n45,atCursor)
equateLoc(curFile,locA,atCursor)
moveCursor(curFile,eLine)
locToCol(curFile,n54,atCursor)
moveCursor(curFile,locA)
sub(n54,lineLength,n54)
if (gtNum(n54,0)) {
while (decNum(n54)) insertChar(curFile," ")
} else if (gtNum(0,n54)) {
while (incNum(n54)) if (is(curFile,space)) clearChar(curFile)
}>
Show the value of a number variable
<alt-8: putMsg("n-variable #: ")
inputNum(n54)
freeBuf(buf54)
insertChar(buf54,"n")
toWord(buf54,n54)
insertRgn(buf54,eFile," is ",all)
toWord(buf54,n[n54])
putMsg(buf54) >
Set the value of a number variable
<alt-9: putMsg("Set n-variable #:")
inputNum(n54)
putMsg("To value:")
inputNum(n[n54])>
Show the ASCII value of the character under the cursor
<ctl-/: copyChar(curFile,n54)
freeBuf(buf54)
toWord(buf54,n54)
insertRgn(buf54,sFile,"Character value under cursor was ",all)
putMsg(buf54)
moveCursor(curFile,eChar) >
Show the current document size
<ctl-1: fileSize(curFile,n54)
freeBuf(buf54)
insertRgn(buf54,sFile,"File size in bytes: ",all)
toWord(buf54,n54)
putMsg(buf54)>
Switch displaying of cursor row-column off/on
<ctl-2: flipFlag(curFile,rowCol) >
Delete all trailing white-space in current document
<ctl-4: equateLoc(curFile,locA,atCursor)
moveCursor(curFile,sFile)
label(1)
if (is(curFile,eFile))
{ equateLoc(curFile,atCursor,locA) return }
moveCursor(curFile,eLine)
moveCursor(curFile,sChar)
label(2)
if (is(curFile,space))
{ clearChar(curFile) moveCursor(curFile,sChar) goto label(2)}
if (is(curFile,9)) .. a TAB
{ clearChar(curFile) moveCursor(curFile,sChar) goto label(2)}
moveCursor(curFile,eLine)
goto label(1) >
Save a learn-sequence to disk, saving it under a number 1 to 2 billion
<ctl-5: putMsg("Save Learn under what #?")
if (inputNum(n54)) saveLearn(n54) >
Load a learn-sequence stored on disk
<ctl-6: putMsg("Load what Learn #?")
if (inputNum(n54)) loadLearn(n54) >
Load and run learn-sequence stored on disk
<ctl-7: putMsg("Input learn # to load & run:")
if (inputNum(n54)) if (loadLearn(n54)) runLearn >
Toggle case-sensitivity of search
<ctl-8: flipFlag(curFile,searchCaps) >
----------------- Interlace Mode -------------------------
Switch to/from interlace display mode
<shft-esc: flipFlag(curFile,lace)>
RGB color set 1
<lamiga-esc:
setRGB(0x005a,0x0fff,0x0f90,0x009f)
>
RGB color set 2
<ramiga-esc:
setRGB(0x005a,0x0fff,0x0fa0,0x0a55)
>
RGB color set 3
<virtual-esc:
setRGB(0x0bb0,0x0000,0x0fff,0x0f80)
>
Change the RGB color register values
<alt-esc:
define(Reg0 ,N_0) ..NOTE: register n-vars must be contiguous (N_10-N_13)
define(Reg1 ,N_1)
define(Reg2 ,N_2)
define(Reg3 ,N_3)
define(KReg0 ,N_14)
define(KReg1 ,N_15)
define(KReg2 ,N_16)
define(KReg3 ,N_17)
define(REGISTER ,N_6)
define(CURCOLOR ,N_7)
define(REG_NUM ,N_10)
define(OFFSET ,N_11)
define(ROW ,N_12)
define(RGB_RED ,N_13)
define(RGB_GREEN ,N_4)
define(RGB_BLUE ,N_5)
define(COLOR_1 ,2)
define(COLOR_2 ,1)
define(XN_10 ,N_8)
define(XN_11 ,N_9)
define(TUNE_COLOR,label(0))
define(COLORMSG ,label(1))
define(FINISHED ,label(2))
getRGB(Reg0,Reg1,Reg2,Reg3)
getRGB(KReg0,KReg1,KReg2,KReg3)
do (ROW,1,15) text("",ROW,15,COLOR_1,49)
text(">>>> Tune RBG Color Registers <<<<",2,23,COLOR_2,0)
text("R:",5,18,COLOR_1,0)
text("G:",6,18,COLOR_1,0)
text("B:",7,18,COLOR_1,0)
text("Test Test ",9,20,1,0)
text("Test Test ",9,-1,2,0)
text("Test Test ",9,-1,3,0)
text("Test Test ",9,-1,4,0)
text(" ARROW keys: new selection",11,20,COLOR_1,0)
text("SHIFT ARROW keys: inc/dec color value",12,20,COLOR_1,0)
text(" ESC/Q/CLICK: use new colors",13,20,COLOR_1,0)
text(" any other key: restore old colors",14,20,COLOR_1,0)
equateNum(REGISTER,0)
equateNum(CURCOLOR,0)
while (inputKey(XN_10)) nothing
while (nothing) {
GOSUB COLORMSG
getKey(XN_10)
switch (XN_10) {
case(normal-buttonDown)
case(normal-esc)
case(normal-q) { GOTO FINISHED }
case(normal-upArrow)
{ decNum(CURCOLOR)
if (gtNum(0,CURCOLOR)) equateNum(CURCOLOR,2) }
case(normal-downArrow)
{ incNum(CURCOLOR)
if (gtNum(CURCOLOR,2)) equateNum(CURCOLOR,0) }
case(normal-leftArrow)
{ decNum(REGISTER)
if (gtNum(0,REGISTER)) equateNum(REGISTER,3) }
case(normal-rightArrow)
{ incNum(REGISTER)
if (gtNum(REGISTER,3)) equateNum(REGISTER,0) }
case(shft-upArrow)
{ equateNum(XN_11,1) GOSUB TUNE_COLOR }
case(shft-downArrow)
{ equateNum(XN_11,-1) GOSUB TUNE_COLOR }
case(shft-leftArrow)
{ equateNum(XN_11,-1) GOSUB TUNE_COLOR }
case(shft-rightArrow)
{ equateNum(XN_11,1) GOSUB TUNE_COLOR }
default { setRGB(KReg0,KReg1,KReg2,KReg3)
GOTO FINISHED }
}
while (inputKey(XN_10)) nothing
}
FINISHED
putMsg(" ") putMsg("")
fullRefresh
return
TUNE_COLOR ..SUBROUTINE to inc/dec a register color value
equateNum(XN_10,n[REGISTER])
and(RGB_BLUE,XN_10,15) div(XN_10,XN_10,16)
and(RGB_GREEN,XN_10,15) div(XN_10,XN_10,16)
and(RGB_RED,XN_10,15)
switch(CURCOLOR) {
case(0) { equateNum(XN_10,RGB_RED) }
case(1) { equateNum(XN_10,RGB_GREEN) }
case(2) { equateNum(XN_10,RGB_BLUE) }
}
add(XN_10,XN_10,XN_11)
if (gtNum(XN_10,15)) equateNum(XN_10,0)
else if (gtNum(0,XN_10)) equateNum(XN_10,15)
switch(CURCOLOR) {
case(0) { equateNum(RGB_RED,XN_10) }
case(1) { equateNum(RGB_GREEN,XN_10) }
case(2) { equateNum(RGB_BLUE,XN_10) }
}
equateNum(XN_10,RGB_RED)
mul(XN_10,XN_10,16)
or(XN_10,XN_10,RGB_GREEN)
mul(XN_10,XN_10,16)
or(XN_10,XN_10,RGB_BLUE)
equateNum(n[REGISTER],XN_10)
return
COLORMSG ..SUBROUTINE to setRGB & display RGB color register contents
setRGB(Reg0,Reg1,Reg2,Reg3)
do (REG_NUM,0,3) {
equateNum(ROW,4)
mul(OFFSET,REG_NUM,10)
add(OFFSET,OFFSET,22)
text("Reg ",ROW,OFFSET,COLOR_1,0)
text(REG_NUM,ROW,-1,COLOR_1,0)
text(":",ROW,-1,COLOR_1,0)
incNum(ROW)
equateNum(XN_10,n[REG_NUM])
and(RGB_BLUE,XN_10,15) div(XN_10,XN_10,16)
and(RGB_GREEN,XN_10,15) div(XN_10,XN_10,16)
and(RGB_RED,XN_10,15)
equateNum(XN_10,COLOR_1)
if (eqNum(CURCOLOR,0) & eqNum(REG_NUM,REGISTER)) equateNum(XN_10,COLOR_2)
text(" ",ROW,OFFSET,COLOR_1,0)
text(RGB_RED,ROW,OFFSET,XN_10,0)
incNum(ROW)
equateNum(XN_10,COLOR_1)
if (eqNum(CURCOLOR,1) & eqNum(REG_NUM,REGISTER)) equateNum(XN_10,COLOR_2)
text(" ",ROW,OFFSET,COLOR_1,0)
text(RGB_GREEN,ROW,OFFSET,XN_10,0)
incNum(ROW)
equateNum(XN_10,COLOR_1)
if (eqNum(CURCOLOR,2) & eqNum(REG_NUM,REGISTER)) equateNum(XN_10,COLOR_2)
text(" ",ROW,OFFSET,COLOR_1,0)
text(RGB_BLUE,ROW,OFFSET,XN_10,0)
incNum(ROW)
}
>
Uedit's "About..." shareware message
<lAmiga-a:
updateDisplay
getFilename(buf54,curfile)
setFileName(curFile," About Uedit...")
text(" ",0,0,0,-2) .. -2 clear screen using color 0
text("UEDIT",3,36,7,0)
text("(for AMIGA & PC)",4,30,0,0)
text("(C) 1986-90 by Rick Stiles. All rights reserved.",6,13,0,0)
text("P.O. Box 666,",7,22,-1,0)
text(" Washington, IN 47501",-1,-1,-1,0)
text(" Uedit is a SHAREWARE programmable text editor for the",9,10,0,0)
text(" technical user. See Uedit-Tutorial for general info",10,10,-1,0)
text(" and instructions. Try Uedit and see how you like it.",11,10,-1,0)
text(" If you USE it, become a REGISTERED USER by ordering",12,10,-1,0)
text(" the unlimited version. ",13,10,-1,0)
text(" (See Uedit-Policy for price & registering info.)",15,10,0,0)
getserialnum(n54)
text("s/n ",16,33,7,0)
text(n54,-1,-1,-1,0)
do(n54,8,67) text(" ",1,n54,2,1)
do(n54,2,17) text(" ",n54,67,-1,1)
equateNum(n54,67)
while (!eqNum(n54,8)) {
text(" ",17,n54,-1,1)
decNum(n54)
}
equateNum(n54,17)
while (!eqNum(n54,1)) {
text(" ",n54,8,-1,1)
decNum(n54)
}
getKeyVal(n53,n53)
setFileName(curFile,buf54)
text(" ",0,0,0,-2) .. -2 clear screen in normalVid
putmsg(" ")
putmsg(" ")
refreshDisplay >
Insert a formfeed character
<lAmiga-f: insertChar(curFile,12) >
Assign new Primitive Mode terminator Ctrl-key
<normal-esc: putMsg("Enter new Primitive Mode terminator CTRL-key")
if (getChar(n54))
if (gtNum(32,n54)) equateNum(pmESC,n54)
putMsg(" ") >
Save changed files during idle periods, if their idle-save flag is set
<idle: getMaxFiles(n52)
decNum(n52)
do (n54,0,n52)
if (not inputWaiting)
if (getflag(buf[n54],changed))
if (getflag(buf[n54],userLocalA)) saveFile(buf[n54]) >
File Requestor
Open File via requester
Bring up file-requester
<virtual-o:
freeBuf(buf54)
insertRgn(buf54,eFile,buf38,hilite)
moveCursor(buf54,efile)
moveCursor(buf54,sChar)
if (not is(buf54,sfile)) if (is(buf54,"/")) clearChar(buf54)
if (fileRequest(buf54,"Select Dir/File",0)) { .. if True, always has 2 lines
freeBuf(buf53)
insertRgn(buf53,efile,buf54,all)
moveCursor(buf53,sfile)
if (not is(buf53,eline)) moveCursor(buf53,eLine)
clearChar(buf53) .. erase the eol
loadFile(buf53)
}
if (isEmpty(buf54)) {
label(0)
putMsg("No selection or no Arp")
returnFalse
}
moveCursor(buf54,sfile) .. puts filename on line 2. outputs "*" if no
if (not is(buf54,"*")) if (not is(buf54,eLine)) {
freeBuf(buf53)
insertRgn(buf53,efile,buf54,line)
runKey(virtual-7) .. store dirname in buf38, if not already there
}
>
-------------------------- end of Config! ----------------------------------
Set max number of files can load for normal editing (1-100, usually 20)
<altCtl-f1:
.. **** delete this line and next 2 lines, if registered user.
alertUser("Must have full Uedit to increase maximum files.")
returnFalse
putMsg("Input max # documents allowed (1-100)")
if (inputNum(n54)) setMaxFiles(n54) >