home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR8
/
SLMRHELP.ZIP
/
SLMRHELP.S
< prev
next >
Wrap
Text File
|
1993-09-30
|
5KB
|
86 lines
/******************************************************************************/
/* Macro file : SLMRHELP.S */
/* Programmer : Todd Fiske */
/* */
/* Purpose : Routines to provide some entry and exit processing for */
/* editing replies and messages in SLMR via TSE */
/* */
/* Revision : 09/29/1993 - first version */
/* History */
/* */
/* Language : SAL 1.0 (Pre-Release) */
/* */
/******************************************************************************/
/******************************************************************************/
/* Globals */
/******************************************************************************/
integer
main_buffer = 0 // primary message-editing buffer
string // tear line text
tear_line[] = '------------tear-line-------everything-above-this-line-will-be-deleted!!--------'
/******************************************************************************/
/* Procedure : Exit Process */
/******************************************************************************/
proc ExitProcess()
GotoBufferID(main_buffer) // return to primary message editing buffer
if lFind(tear_line, '^g') // if tear line found at start of line
BegFile() // go to top of file
MarkChar() // start a block
lRepeatFind() // mark up to...
Down() // ...and including the tear line...
Down() // ...and the blank line following
DelBlock() // delete it
endif
// else, user may have already cleaned it up
end
/******************************************************************************/
/* Function S : Proper - very simple proper-casing function */
/******************************************************************************/
string proc Proper(string sName)
string sWork[30] = sName
Lower(sWork)
return ( UpCase(sWork) + SubStr(sWork, 2, Length(sWork)-1 ) )
end
/******************************************************************************/
/* Procedure : When Loaded */
/******************************************************************************/
proc WhenLoaded()
string
sender_name[30] = ""
BegFile() // try to get parent message senders name
if lFind('From:', '^g') // look for From: label at start of line
WordRight() // go to next word
MarkWord() // mark it
sender_name = Proper( GetMarkedText() ) // snip it and proper-case it
UnMarkBlock()
EndFile() // go to end of file
AddLine(tear_line) // add a tear line
AddLine() // add another blank line
AddLine('Hi -') // add salutation
BegFile() EndFile() // leave first line visible if possible
Left() Left() // move to within salutation
InsertText(sender_name, _INSERT_) // insert it into the salutation
EndLine() // go to end of line
CReturn() // add two blank lines, leaving cursor
CReturn() // at eof in ready-to-write position
main_buffer = GetBufferID() // save id of current buffer
Hook(_ON_EXIT_CALLED_, ExitProcess) // link exit process
endif
// else, if not found, assume that we're not in a message file, so don't do
// any special processing
Set(RightMargin, 79) // set right margin
Set(WordWrap, ON) // turn word wrap on
end