🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
3 messages
3 total messages Started by MLC Thu, 01 Feb 2007 14:51
[Dialog] Ping Paul Blarmy: script
#195105
Author: MLC
Date: Thu, 01 Feb 2007 14:51
142 lines
4379 bytes
Hi Paul,
this is the script to plonk with address and with an expire date.
Remember to compile it with Ctrl+F9, in other words don't compile & run it
inside the script window with F9 (the green arrow): from the script window
it wouldn't work. Then give it a button and/or a shortcut to use it.  

I hope it's what you asked, it seems to work but I don't have fully tested
it 'cause lack of time.

Ciao :-)


Program PlonkAddressExpire;  //  1 Febbraio 2007, MLC
uses Forms, StdCtrls;

const
 numM = 1; // number of months you want to plonk (from the current day)
 
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 ExpireAfter: string;
 var today, after: TDateTime;
begin
 today:=Now;
 after:=IncMonth(today, numM);
 result:=' Expire:'+(FormatDateTime('yyyymmdd', after));
end;

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:=' '+ExpireAfter
    else myMemo.text:=' +"'+mail+'"'+ExpireAfter;
   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.

-- 
Maria Luisa C - 01/02/2007 15.15.19
The trouble with being punctual is that nobody's there to appreciate it.
Franklin P. Jones
Re: [Dialog] Ping Paul Blarmy: script
#195116
Author: Paul Blarmy
Date: Thu, 01 Feb 2007 18:52
22 lines
2314 bytes
On Thu, 1 Feb 2007 15:51:22 +0100, MLC wrote...

> Program PlonkAddressExpire;  //  1 Febbraio 2007, MLC

I can't believe this! What a wonderful gesture to go to the trouble of 
doing this for me. Thank you so very much. Hopefully others will find it 
useful as well.

At present my test machine is with my son and I am having problems with 
40tude on my main machine (see thread above) but as soon as I get it 
sorted I will put your script to good use.

Again, thank you so very much.

Ché persona meravigliosa siete :-)

I hope that translates as I meant it - if not, blame Google translation 
machine!!)

-- 
EMail address is disposable and never checked.
Registered Linux user #439066.
Re: [Dialog] Ping Paul Blarmy: script
#195122
Author: MLC
Date: Thu, 01 Feb 2007 20:03
18 lines
1788 bytes
giovedì 1 febbraio 2007 Paul Blarmy ha scritto:

[...]

> Again, thank you so very much.

> Ché persona meravigliosa siete :-)

Wow, thank you :-D

> I hope that translates as I meant it - if not, blame Google translation 
> machine!!)

It's almost correct, and very kind too!

-- 
Maria Luisa C - 01/02/2007 21.02.09
Intolerance is the last defense of the insecure.
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