home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d7xx
/
d770
/
uedit.lha
/
Uedit
/
Jenkins2.LZH
/
BlockIndent-Outdent
next >
Wrap
Text File
|
1991-04-08
|
3KB
|
79 lines
======= BlockIndent-Outdent ===============================
COPYRIGHT 1991
Robert A. Jenkins, Ph.D.
22901 Shagbark Lane
Miller Woods, IL 60411
(708) 758-0344
All Rights Reserved
Rick Stiles may distribute it as he pleases.
=============================================================================
In writing a command I often find that I need to change the indentation of a
block of text. Rick's match indent to the preceding line only works in simple
situations. This command is much more powerful. It will shift the indent of
the hilighted block left or right as you like.
Hilite a block of text.
Hit shft-tab
Enter the amount of shift, pos or negative, and hit esc.
=============================================================================
Block Indent-Outdent
<shft-tab:
putMsg("Input incremental indent, +-n:")
inputNum(n50)
moveCursor(curFile,sHilite)
if (gtNum(n50,0)) { ..indent
..putMsg("starting indent")..debug
while (gtLoc(curFile,eHilite,atCursor)) {
..alertUser("starting a line")..debug
equateNum(n51,n50)
while (gtNum(n51,0)) {
insertChar(curFile," ")
decNum(n51) }
moveCursor(curFile,sLine)
moveCursor(curFile,downline)
..alertUser("finished a line")
} }
else { ..outdent
while (gtLoc(curFile,eHilite,atCursor)) {
if (is(curFile,blankLine)) goto label(0)
equateNum(n51,n50)
while (gtNum(0,n51)) {
..alertUser("testing")..debug
..if (is(curFile,whiteSpace)) alertUser("whiteSpace") ..debug
if (!is(curFile,whiteSpace)) {
vScroll(atCursor)
alertUser("Aborted: At this point requested outdent > total indent")
return }
clearChar(curFile)
incNum(n51) }
LABEL(0)
moveCursor(curFile,downline)
if (not is(curFile,sLine)) moveCursor(curFile,sLine) } }
>Saturday 23-Feb-91 21:36:46
Test Suite
-----
BEGIN
fhPtr := Dos.Open (ADR (pathName), Dos.newFile);
WriteString ('Saving>'); WriteLine (pathName);
transactionPtr := firstTransactionPtr;
li := Dos.Write (fhPtr, ADR (nTransactions), SIZE (CARDINAL));
FOR i := 1 TO nTransactions DO
li := Dos.Write (fhPtr, transactionPtr, SIZE (Transaction));
liquidationBlockPtr := transactionPtr^.firstLiquidationBlockPtr;
WHILE liquidationBlockPtr # NIL DO
li := Dos.Write (fhPtr, liquidationBlockPtr, SIZE (LiquidationBlock));
liquidationBlockPtr := liquidationBlockPtr^.nextPtr
END;
transactionPtr := ADR (transactionPtr^.nextPtr^);
END;
Dos.Close (fhPtr);
WriteLine ('Data saved');
END Save;
-----
more text