home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
100-199
/
ff146.lzh
/
DmeMacros
/
CommentedMacros
/
C.switch.edrc
< prev
next >
Wrap
Text File
|
1988-05-28
|
2KB
|
44 lines
# insert lines for body of text; write marker in text to save location;
# move cursor up one line (may have to add a line if at the top) and move
# to the first character in the line (if there are no characters in the
# line, the cursor moves to the leftmost column;
repeat 4 insline `+' up firstnb
# if there is text on this line, insert a line between this line and the
# first line of the template (unless the character is a left brace, in
# which case I treat the line as being blank for appearance's sake
if c>32 `if c<>123 `down insline'' down
# go down to end of template and insure that there is at least one blank
# line between it and any text below it;
repeat 4 down firstnb
if c>32 insline
# move back to marker and delete it;
repeat 4 up firstnb del
# write the body of the template; write a marker for later search & replace
# needed to complete comment with branching expression; place cursor in
# position to write between parentheses in branching expression;
`switch ()' firstnb down
`{' firstnb down down
`} /* switch + */' findstr `)' prev
# prompt for the branching expression (it will printed as a string at the
# cursor location; goto first character of the expression and read text into
# the variable $scanf until you get to a right parenthesis (will not stop at
# blanks); replace the marker in the comment with the text in $scanf; move
# to blank line between braces and indent for entry of next line of code;
escimm (`) first find `(' right while c<=32 right scanf %[~)] down findr `+' $scanf firstnb up tab