🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #45441

Re: [slrn] post_file_hook

#45441
From: John E. Davis
Date: Thu, 17 Dec 1998 00:00
45 lines
2150 bytes
On 11 Dec 1998 04:51:01 GMT, Dawn Owens-Nicholson <bluemoon@ux6.cso.uiuc.edu>
wrote:
>define last_headers (file)
>{
[...]
>     hash = Assoc_Type[String_Type],
[...]

>  define my_last_messageid ()
>  {
>     variable my_hash = last_headers (get_variable_value ("save_posts"));
>     message (my_hash["Message-Id"]);
>     .
>     .
>  }

   It is probably a good idea to declare the associative array as
   follows:

     hash = Assoc_Type [String_Type, ""];

   This will cause "" to be returned when one tries to access a
   non-existent entry in the associative array.

>might be up your alley (be sure to match the capitalization slrn uses for
>headers when requesting headers from the hash).

    One can also use `strup' to convert a string to uppercase before
    accessing the array, e.g.,
    
       hash [strup(header_name)] = header_value;
         .
	 .
       message (hash[strup ("Message-Id")]);

Keep in mind that one needs slang version 1.3.x to use associative
arrays and all the other goodines that the new version provides.  It
is available from ftp://space.mit.edu/pub/davis/slang/snapshots and is
a drop-in replacement for 1.2.x.  The next officially released version
of slang will be 1.4.x.  The 1.3.x versions are snapshots of what will
be 1.4.x.

--John

Technical Details
Message-ID: <slrn77frbo.a4o.davis@mygir.davis.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <slrn76ts80.3vvipaj.news@manassa.demon.co.uk> <slrn77195h.cai.bluemoon@ux6.cso.uiuc.edu>

Show Full Headers
Complete Article Headers
Message-ID: <slrn77frbo.a4o.davis@mygir.davis.net>
Subject: Re: [slrn] post_file_hook
Date: Thu, 17 Dec 1998 00:00:00 +0000
From: davis@space.mit.edu (John E. Davis)
References: <slrn76ts80.3vvipaj.news@manassa.demon.co.uk> <slrn77195h.cai.bluemoon@ux6.cso.uiuc.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 423217662
X-Complaints-To: usenet@eecs-usenet-02.mit.edu
X-Trace: eecs-usenet-02.mit.edu 913894634 28759 18.75.2.45 (17 Dec 1998 11:37:14 GMT)
Organization: Center for Space Research
User-Agent: slrn/0.9.5.4 (UNIX)
NNTP-Posting-Date: 17 Dec 1998 11:37:14 GMT
Newsgroups: news.software.readers