🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #264854

Re: Newsreaders eh?

#264854
From: Jim S
Date: Mon, 19 Apr 2021 18:40
145 lines
4737 bytes
On Mon, 19 Apr 2021 20:17:04 +0200, Bernd Rose wrote:

> On Mon, 19th Apr 2021 18:28:10 +0100, Jim S wrote:
> 
> [Remember keyboard shortcuts] 
>>> Add all relevant commands as icons to toolbars. This way, you can access
>>> them by mouse *and* (by just pointing with the mouse) read the shortcut
>>> from the tooltip.
> [...] 
>> That seems to have gone well.
> 
>> Since I have not used 'plonk with address' for years (probably,) it would
>> seem unnecessary for me. I seem to recall that I got it from the script
>> library and seemed quite complex (that means I didn't understand it and
>> just copied blindly). Is there a minor tweak to prevent the window opening
>> and hide/ignore the thread as above: otherwise I will go on forgetting
>> about it.
> 
> There may be several versions of the script around. The original version
> is from Marie Luisa (MLC), IIRC, and probably 15 years old. Can you please
> post your whole version here? Then I'll have a look.
> 
> Bernd

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: <kqcyory5n6m9$.113ms19h3vssc$.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-mail
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> <ev667nuh6zgb$.17zvfeooqr4kd$.dlg@40tude.net> <m3ngctbsucpk$.dlg@b.rose.tmpbox.news.arcor.de> <qm01udb0v0t6.syur7uvsi92q$.dlg@40tude.net> <gu7xr5wvx0cv$.dlg@b.rose.tmpbox.news.arcor.de> <5ifdtcfysmqe.c88u41oufaun.dlg@40tude.net> <1fevaouhkj7bx.dlg@b.rose.tmpbox.news.arcor.de> <1batsl3tlcz2g.1c3po4uxfkisw$.dlg@40tude.net> <13q2mi3vl45dn.dlg@b.rose.tmpbox.news.arcor.de>

Show Full Headers
Complete Article Headers
Message-ID: <kqcyory5n6m9$.113ms19h3vssc$.dlg@40tude.net>
Subject: Re: Newsreaders eh?
Date: Mon, 19 Apr 2021 19:40:57 +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> <ev667nuh6zgb$.17zvfeooqr4kd$.dlg@40tude.net> <m3ngctbsucpk$.dlg@b.rose.tmpbox.news.arcor.de> <qm01udb0v0t6.syur7uvsi92q$.dlg@40tude.net> <gu7xr5wvx0cv$.dlg@b.rose.tmpbox.news.arcor.de> <5ifdtcfysmqe.c88u41oufaun.dlg@40tude.net> <1fevaouhkj7bx.dlg@b.rose.tmpbox.news.arcor.de> <1batsl3tlcz2g.1c3po4uxfkisw$.dlg@40tude.net> <13q2mi3vl45dn.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
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
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Nntp-Posting-Date: Mon, 19 Apr 2021 18:40:56 UTC
Organization: virginmedia.com
Mime-Version: 1.0
User-Agent: 40tude_Dialog/2.0.15.84
X-Complaints-To: http://netreport.virginmedia.com
Lines: 145