HP3000-L Archives

November 2001, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Tue, 27 Nov 2001 11:09:20 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
Re:
> If I have read in a STDIN record that varies in record length from 1 byte to
> 1920 bytes.  Is this the right code below?  I have some fishy things
> happening...
>
> readx(stdin_record,-1920);
>
> STRMOVE(1920,stdin_record,1,email_message,1);

len := readx (stdin_record, -1920);
if ccode <> cce then
   ...handle the error or EOF
else
   strmove (len,                    {# of bytes}
            stdin_record, 1,        {source}
            email_message, 1);      {destination}

But, I wouldn't use "-1920".  Instead:

   len := readx (stdin_record, -sizeof (stdin_record));

or:

   len := readx (email_message, -strmax (email_message));
   if ccode <> cce then
       ...
   else
      setstrlen (email_emssage, len);
Stan Sieler                                           [log in to unmask]
www.allegro.com/sieler/wanted/index.html          www.allegro.com/sieler

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2