🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #261408

Re: Request help with 40tude dialog program syntax

#261408
From: Stijn De Jong
Date: Sat, 31 Dec 2016 20:45
43 lines
2511 bytes
Op Sat, 31 Dec 2016 20:11:30 +0000 (GMT), Rodney Pont schreef:

> Does id1 and id2 need to be in quotes, 'id1' 'id2'

I do not know, but my plan was to define the Remove_Headers variable at the 
time that the identity was determined, so that I wouldn't even need an if 
statement at that very moment.

But when I do that, I get the error that the Remove_Headers is a duplicate!

This is the original that works without the Remove_Header variable:
https://i.imgsafe.org/817947489d.jpg

function From2Identity(from: String): String;
begin   
  if (StrMatch(from, 'Stijn De Jong <stijndekoning@nlnet.nl>')) then
    result := 'id1'
  else if (StrMatch(from, 'First1 Last2 <email2@domain.com>')) then
    result := 'id2'
  else
    result := 'unknown';
end;

This is the same as above, but with the Remove_Header inserted:
https://i.imgsafe.org/8182381b0a.jpg

function From2Identity(from: String): String;
begin   
  if (StrMatch(from, 'Stijn De Jong <stijndekoning@nlnet.nl>')) then
    result := 'id1'
    Remove_Headers := 'User-Agent: ,Message-ID: ';
  else if (StrMatch(from, 'First1 Last2 <email2@domain.com>')) then
    result := 'id2'
    Remove_Headers := 'User-Agent: ,Content-Transfer-Encoding: ';
  else
    result := 'unknown';
     Remove_Headers := 'User-Agent: ,Mime-Version: '; 
end;

What I can't mentally fathom yet is why I can't just re-define the variable 
"Remove_Header" at any point whatsoever in the script. 

That's really where I think I'm most stumbled.
Technical Details
Message-ID: <o495cr$177$1@news.mixmin.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> <nfcnzpzcvasbuvgzrhx.oj2tz62.pminews@ouse.infohit.me.uk>

Show Full Headers
Complete Article Headers
Message-ID: <o495cr$177$1@news.mixmin.net>
Subject: Re: Request help with 40tude dialog program syntax
Date: Sat, 31 Dec 2016 21:45:08 +0100
From: Stijn De Jong <stijndekoning@nlnet.nl>
References: <o491jh$7jr$1@gioia.aioe.org> <o4926s$933$1@gioia.aioe.org> <nfcnzpzcvasbuvgzrhx.oj2tz62.pminews@ouse.infohit.me.uk>
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: alt.windows7.general,news.software.readers
Organization: Mixmin
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 31 Dec 2016 20:45:16 -0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="f488a3b4fbd3c0b3b3a811b4d4a45852bb9fb7ae";
 logging-data="1255"; mail-complaints-to="abuse@mixmin.net"
X-Received-Body-CRC: 1470046773
X-Received-Bytes: 2409