Thread View: news.software.readers
2 messages
2 total messages
Started by John E. Davis
Wed, 30 Oct 1996 00:00
Re: slrn: problem with slang macro and startup_hook
Author: John E. Davis
Date: Wed, 30 Oct 1996 00:00
Date: Wed, 30 Oct 1996 00:00
25 lines
1343 bytes
1343 bytes
On 30 Oct 1996 13:04:39 GMT, Jason Costomiris <jcostom@shaft.sjis.com>
wrote:
>define starup_hook ()
>{
> if(strcmp (server_name (), "betanews"))
> {
> set_string_variable("signature",".sig-betanews");
> }
>}
Keep in mind that strcmp compares two strings in a case-sensitive
manner. It returns 0 if they contain the same characters. Your test
should be written:
if (0 == strcmp (server_name (), "betanews"))
Note: this assumes that the `server_name' function will return
"betanews" and not, e.g., "betanews.com".
--
John E. Davis Center for Space Research/AXAF Science Center
617-258-8119 MIT 37-662c, Cambridge, MA 02139
http://space.mit.edu/~davis
Re: slrn: problem with slang macro and startup_hook
Author: John E. Davis
Date: Wed, 06 Nov 1996 00:00
Date: Wed, 06 Nov 1996 00:00
31 lines
1450 bytes
1450 bytes
On 30 Oct 1996 19:36:32 GMT, Jason Costomiris <jcostom@shaft.sjis.com>
wrote:
>Ok, now I have:
>define starup_hook ()
>{
> if (0 == strcmp (server_name (), "betanews.microsoft.com"))
> {
> set_string_variable("signature",".sig-ms");
> }
>}
You should rename the function from starup_hook to startup_hook.
>if ($server_name =~ /betanews/) {
> $signature = ".sig-ms";
>}
>
>Is there a similar construct for slang macros?
Sure. Use:
if (string_match (server_name (), "betanews", 1))
set_string_variable ("signature", ".sig-ms");
--
John E. Davis Center for Space Research/AXAF Science Center
617-258-8119 MIT 37-662c, Cambridge, MA 02139
http://space.mit.edu/~davis
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads