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.function.edrc
next >
Wrap
Text File
|
1988-05-28
|
2KB
|
46 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 5 insline `+' ifelse t insline up firstnb
# if there is text on this line, insert two lines between this line and the
# first line of the template; otherwise, go up one more line and check for
# text; if it's there insert one line between that line and the template;
# you are now guaranteed that at least two blank lines are between the tem-
# plate and any text above it;
ifelse c>32 `down repeat 2 `insline down'' `ifelse t insline up firstnb if c>32 `down insline' down down'
# go down to end of template and insure that there are at least two lines
# between it and any text below it;
repeat 5 down firstnb
ifelse c>32 `insline insline' `if b insline down firstnb if c>32 insline up'
# move back to marker and delete it;
repeat 5 up firstnb del
# write the body of the template; write a marker for later search & replace
# needed to complete comment with function name; place cursor in position to
# write between parentheses in test expression;
` ()' firstnb left down down
`{' firstnb down down
`} /* + () */' findstr ` (' up prev
# prompt for the name of the function (it will printed as a string at the
# cursor location; goto first character of name and read the function name
# into the variable $scanf; replace the marker in the comment with the name
# in $scanf (function name); move to blank line between braces and indent
# for entry of next line of code;
escimm (`) firstnb scanf %s down findr `+' $scanf firstnb up tab