Ted,
Your suggestion using the two LFs to determine where my message body begins
worked.
Here is the code I used in PASCAL. I concatenated the LFs using the
STRMOVE.
Thanks....
CONST
INPUT_MAX = 1920;
lf = CHR(10);
VAR
loop_control : shortint;
lf_pos : shortint;
lf_lf : STRING[2];
lf_lf_pos : shortint;
PROCEDURE readx;
INTRINSIC;
BEGIN
email_message := ' ';
lf_lf := ' ';
FOR loop_control := 1 TO INPUT_MAX DO
stdin_record[loop_control] := ' ';
readx(stdin_record,INPUT_MAX);
STRMOVE(INPUT_MAX,stdin_record,1,email_message,1);
email_message := STRRTRIM(email_message);
lf_pos := STRPOS(email_message,lf);
WRITELN('lf_pos ', lf_pos);
STRMOVE(1,lf,1,lf_lf,1);
STRMOVE(1,lf,1,lf_lf,2);
lf_lf_pos := STRPOS(email_message,lf_lf);
WRITELN('lf_lf_pos ', lf_lf_pos);
lf_lf_pos := STRPOS(email_message,'KEN BORN');
WRITELN('MESSAGE POS', lf_lf_pos);
WRITELN(email_message);
END;
The results are as follows:
lf_pos 55
lf_lf_pos 738
MESSAGE POS 740
-----Original Message-----
From: Ted Ashton [mailto:[log in to unmask]]
Sent: Monday, April 09, 2001 10:06 AM
To: Born, Ken
Subject: Re: Sendmail --> detemining where header ends and message
begins
Ken,
I see two options. First, use strpos to find to LFs next to each
other--bytestream file lines terminate with LFs (ASCII 10) rather than CRs.
Second, open the file with HPFOPEN's item 77 set to 0 (this is a somewhat
tentative answer--I've played with this a bit, but not extensively). This
mode
does record-based emulation for bytestream files. That way, you can read
the
lines one at a time.
HTH,
Ted
--
Ted Ashton ([log in to unmask]), Info Sys, Southern Adventist University
==========================================================
How often might a man, after he had jumbled a set of letters in a bag, fling
them out upon the ground before they would fall into an exact poem, yea, or
so much as make a good discourse in prose. And may not a little book be as
easily made by chance as this great volume of the world.
-- Tillotson, Archbishop
==========================================================
Deep thoughts to be found at http://www.southern.edu/~ashted
* To join/leave the list, search archives, change list settings, etc *
* please visit http://raven.utc.edu/archives/hp3000-l.html *
|