Article View: news.software.readers
Article #265521Re: Newsreaders eh?
From: Jim S
Date: Tue, 26 Apr 2022 17:31
Date: Tue, 26 Apr 2022 17:31
161 lines
4742 bytes
4742 bytes
On Tue, 26 Apr 2022 18:27:06 +0200, Bernd Rose wrote:
> On Tue, 26th Apr 2022 09:23:21 +0100, Jim S wrote:
>
>>> Program DoPlonk;
>>> Begin
>>> PostKey(79, false, true, false, false, false, false, false, false);
>>> ADo('AddPlonkFilter');
> ^^^^^^^^^^^^^^
>>> ADo('Ignore');
>>> ADo('MarkRead');
>>> ADo('RefreshView');
>>> End.
>>>
>>> Program DoSubjPlonk;
>>> Begin
>>> PostKey(79, false, true, false, false, false, false, false, false);
>>> ADo('AddSubjectPlonkFilter');
> ^^^^^^^^^^^^^^^^^^^^^
>>> ADo('Ignore');
>>> ADo('MarkRead');
>>> ADo('RefreshView');
>>> End.
>>>
>>> HTH.
>>> Bernd
>>
>> Follow-up
>> Apart from their names aren't these two scripts identical?
>
> Not entirely. ;-) I marked the relevant differences above.
>
> Originally, you wanted to be able to alternatively plonk on name
> (= first script) as well as on subject (= second script). Both
> approaches require the call of different Dialog-internal functions.
> The later "housekeeping" in these scripts is identical, though...
>
> Bernd
PS. Just checked and found this:
Program PlonkWithAddress; //v0.4 24/Gennaio/2005, by MLC
uses Forms, StdCtrls;
var
myForm: TForm;
myMemo: TMemo;
mail: string;
Function EmptyClipboard:boolean; external 'EmptyClipboard@user32.dll
stdcall';
Function OpenClipboard(hWndNewOwner: INTEGER):boolean; external
'OpenClipboard@user32.dll stdcall';
Function CloseClipboard:boolean; external 'CloseClipboard@user32.dll
stdcall';
function ItemCount(s: string; sep: char): integer;
var
i, r: integer;
stemp: string;
begin
stemp:=s;
r:=0;
i:=Pos(sep,stemp);
while i<>0 do
begin
r:=r+1;
delete(stemp, i, 1);
i:=Pos(sep,stemp);
end;
result:=r;
end;
function RevStr(s: string ): string;
var
i: integer;
s2: string;
begin
s2 := '';
for i:=1 to Length(s) do
begin
s2:=s[i]+s2;
end;
result:=s2;
end;
Procedure ClearClipboard;
Begin
OpenClipboard(0);
EmptyClipboard;
CloseClipboard;
end;
Procedure GetMsgBody;
begin
ClearClipboard;
myMemo.Clear;
ADo('ArticlePane');
ADo('SelectAll');
Ado('Copy');
myMemo.PasteFromClipboard;
end;
Function GetAddress: string;
var
i: integer;
addr: string;
begin
i:=0;
addr:='';
while (i < myMemo.Lines.count-1) do
begin
if Pos('From:', myMemo.lines.Strings[i]) = 1 then
begin
addr:=myMemo.lines.Strings[i];
break;
end
else i:=i+1;
end; //while
i:=ItemCount(addr, '<');
if (i > 0) then
begin
addr:=RevStr(addr);
i:=Pos('<',addr);
addr:=copy(addr, 1, i);
addr:=RevStr(addr);
end else addr:='';
result:=addr;
end;
Procedure BuildContainers;
begin
myMemo := tMemo.Create(myForm);
myMemo.Parent := myForm;
myMemo.Width := Application.Mainform.width;
end;
Begin
myForm := tForm.Create(nil);
lockdisplay;
try
BuildContainers;
ADo('ShowHeaders');
GetMsgBody;
ADo('ShowHeaders');
mail:=GetAddress;
if (mail='') then myMemo.text:=' '
else myMemo.text:=' +"'+mail+'"';
myMemo.SelectAll;
myMemo.CopyToClipboard;
ADoLater('AddPlonkFilter');
PostKey(35, false, false, false, false, false, false, false, false);
//end
PostKey(86, false, false, true, false, false, false, false, false);
//Ctrl+V
finally
unlockdisplay;
myForm.free;
end;
End.
--
Jim S
Technical Details
Message-ID:
<1mwpdb8pl3zui.1vegdxk5sgg8a.dlg@40tude.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<gkfgs5nfgug4$.1q24cwbv2tx3l.dlg@40tude.net> <17ztypxu0bb1p$.dlg@b.rose.tmpbox.news.arcor.de> <MPG.3ae611f563b51ec39897a1@news.virginmedia.com> <12pj6jxdq5dve.dlg@b.rose.tmpbox.news.arcor.de> <nffeayqllhu0.mcbv8hdbzjaj$.dlg@40tude.net> <tmftplondpm1$.dlg@b.rose.tmpbox.news.arcor.de> <1kgegv1ez4y6x.1oislh7yuoyq4.dlg@40tude.net> <xto1ppxerkk9$.dlg@b.rose.tmpbox.news.arcor.de> <1grn3iv2400mn$.4v5cciiylzwu$.dlg@40tude.net> <pd29uqle39pb.dlg@b.rose.tmpbox.news.arcor.de>Show Full Headers
Complete Article Headers
Message-ID: <1mwpdb8pl3zui.1vegdxk5sgg8a.dlg@40tude.net> Subject: Re: Newsreaders eh? Date: Tue, 26 Apr 2022 18:31:12 +0100 From: Jim S <jim@jimXscott.co.uk> References: <gkfgs5nfgug4$.1q24cwbv2tx3l.dlg@40tude.net> <17ztypxu0bb1p$.dlg@b.rose.tmpbox.news.arcor.de> <MPG.3ae611f563b51ec39897a1@news.virginmedia.com> <12pj6jxdq5dve.dlg@b.rose.tmpbox.news.arcor.de> <nffeayqllhu0.mcbv8hdbzjaj$.dlg@40tude.net> <tmftplondpm1$.dlg@b.rose.tmpbox.news.arcor.de> <1kgegv1ez4y6x.1oislh7yuoyq4.dlg@40tude.net> <xto1ppxerkk9$.dlg@b.rose.tmpbox.news.arcor.de> <1grn3iv2400mn$.4v5cciiylzwu$.dlg@40tude.net> <pd29uqle39pb.dlg@b.rose.tmpbox.news.arcor.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: news.software.readers Organization: A noiseless patient Spider Lines: 161 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit User-Agent: 40tude_Dialog/2.0.15.84 Cancel-Lock: sha1:w4Cy6AayJiZpI7oEhQTYRk1rhno= X-Face: 6?%9&O$Ef&~f7s}qiMjb18=&)9a}$:4ew_:i]WBa@mRH`'@/o:a%fN7*zR?=eniL[:"ISp# +H|<2fJ-bj?iPuy0;!oXjv,A&y5hs'QrwbWsUXdo3%Fyhz?o`*G>XV8jJrVtvH6v_9&CK[)\loOez@ g4o0'h