🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #261667

Re: Request help with 40tude dialog program syntax

#261667
From: JJ
Date: Fri, 06 Jan 2017 09:57
33 lines
2996 bytes
Good to know that it works for you.

One thing you should know is that the `StrMatch()` function compares the
`Pattern` argument against the start of the `str` argument. So when you use
the function to compare the `newsgroup` argument in the
`NewsGroup2Identity()` function, and the message was posted to multiple
newsgroups, that function can only check the first listed newsgroup.

For example, suppose you're using the function like so:

  if StrMatch(newsgroup, 'news.software.readers') then //...

If the contents of the newsgroup variable is:

  alt.test, news.software.readers

Then the above check will never match.

For the sake of flexibility, here's a function that work like `StrMatch()`
but the pattern can match anywhere in the string being searched. i.e. the
pattern can be at start, at middle, or at end. String comparison is case
sensitive, just like `StrMatch()` does.

  function StrContains(const Str: string; const Pattern: string): boolean;
  begin
    result:= pos(Pattern, Str) > 0;
  end;

Insert it into anywhere in the script outside of any other function and use
it just like `StrMatch()`. e.g.

  if StrContains(newsgroup, 'news.software.readers') or
    StrContains(newsgroup, 'alt.windows7.general') then //...
Technical Details
Message-ID: <18a15xlqpx8bu$.p7s6f5qnpimv$.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
References: <o491jh$7jr$1@gioia.aioe.org> <o4926s$933$1@gioia.aioe.org> <o492qg$a9k$1@gioia.aioe.org> <1ibo1gzmbqy5b.33119bupvh2q.dlg@40tude.net> <o4h57j$hhe$6@news.mixmin.net> <o4jr33$u80$1@news.mixmin.net> <7vpx5y09pu98.1sukl5d600sda$.dlg@40tude.net> <o4mllr$1tes$1@gioia.aioe.org> <o4mmls$1ufs$1@gioia.aioe.org> <o4mp2u$1mp$1@gioia.aioe.org> <o4mqdl$3dn$1@gioia.aioe.org>

Show Full Headers
Complete Article Headers
Message-ID: <18a15xlqpx8bu$.p7s6f5qnpimv$.dlg@40tude.net>
Subject: Re: Request help with 40tude dialog program syntax
Date: Fri, 6 Jan 2017 16:57:31 +0700
From: JJ <jj4public@vfemail.net>
References: <o491jh$7jr$1@gioia.aioe.org> <o4926s$933$1@gioia.aioe.org> <o492qg$a9k$1@gioia.aioe.org> <1ibo1gzmbqy5b.33119bupvh2q.dlg@40tude.net> <o4h57j$hhe$6@news.mixmin.net> <o4jr33$u80$1@news.mixmin.net> <7vpx5y09pu98.1sukl5d600sda$.dlg@40tude.net> <o4mllr$1tes$1@gioia.aioe.org> <o4mmls$1ufs$1@gioia.aioe.org> <o4mp2u$1mp$1@gioia.aioe.org> <o4mqdl$3dn$1@gioia.aioe.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail
Newsgroups: news.software.readers,alt.windows7.general,alt.os.linux
Lines: 33
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.albasani.net xsjMkZAyYDv5gHy9no/w5yT7kFt6+FjkDiUlu+qTWeVNdGJ9hOQfGkMv3zxWrRiIaET/BOOPXQYJVwju3vE61A==
NNTP-Posting-Date: Fri, 6 Jan 2017 09:57:30 +0000 (UTC)
Injection-Info: news.albasani.net; logging-data="UKl12xJbZ/ua/RjVlYHVSWxfuRh5O5Ouu3ikFcuEr6OtrDV3d9oApyEV3zmhg/xJMlseG8SdOf3BtQyEVyv5EbByEm3QYJYO5r0Jxrh9ByOtgOEL2+6GS9FNBZJHFTRB"; mail-complaints-to="abuse@albasani.net"
User-Agent: 40tude_Dialog/2.0.15.84
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
Cancel-Lock: sha1:RgtZtVzpG35MZBu2Xq6IhW71Qu0=
X-Received-Bytes: 2975
X-Received-Body-CRC: 3697981600