🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by Barry Jones Mon, 05 Apr 2004 21:47
ReplyToAll
#145824
Author: Barry Jones
Date: Mon, 05 Apr 2004 21:47
59 lines
2994 bytes
I'm working on a ReplyToAll script, and could use some help. I'm not a
Delphi person. I borrowed code (incorrectly) from Marcus' and Ingo's
ScriptChangeHeader. I used Message.count, which is not recognized. Can
someone help out up to this point? I'll continue when this much works.

Also, is there a way to put a string in a header field other than a char at
a time using Postkey?
.........................................................................
Program ReplyToAll;
var i:integer;
    ToggleCount:integer;
    s:string;
    ToField:string;
    CcField:string;
    FoundTo:boolean;
    FoundCc:boolean;
Begin      
    //Initialize
    ToField:='';
    CcField:='';
    FoundTo:=False;
    FoundCc:=False;
    i:=0;
    ToggleCount:=0;
        
    while ((ToggleCount<2) and (FoundTo=false) and (FoundCc=false)) do
    Begin
        ADo('ShowHeaders'); 
	//Since this is a toggle, and I don't know what the state is,
        //I do this a maximum of twice.
        while (i<(message.count-1)) do
        Begin
            s:=message.strings[[i]];
            if s='' then break; //only scan through headers
            if (s[0]='T' and s[1]='o' and s[2]=':') then 
		//should use a substring statement instead
            Begin
                ToField:=s;
                FoundTo:=True;
            End
            if (s[0]='C' and s[1]='c' and s[2]=':') then
            Begin
                CcField:=s;
                FoundCc:=True;
            End
        End
    End
    ADo('ReplyByEmail');
    //Just trying to see if the data can be put in the message first.
    //If this works, I'll put them in the appropriate header fields
    writeln(ToField);
    writeln(CcField);
End.
...................................................................

Any help or coding style improvements is much welcomed.

-- 
Barry
Re: ReplyToAll
#145889
Author: Barry Jones
Date: Wed, 07 Apr 2004 03:10
66 lines
3317 bytes
On Mon, 05 Apr 2004 21:47:33 GMT, Barry Jones wrote:

> I'm working on a ReplyToAll script, and could use some help. I'm not a
> Delphi person. I borrowed code (incorrectly) from Marcus' and Ingo's
> ScriptChangeHeader. I used Message.count, which is not recognized. Can
> someone help out up to this point? I'll continue when this much works.
> 

I reworked the code a bit. It compiles, but needs work. I've introduced a
variable Message:TStringlist, but I don't know how to initialize it. Any
ideas? Thanks.
........................................................................
Program ReplyToAll;
var i:integer;
    ToggleCount:integer;
    s:string;
    ToField:string;
    CcField:string;
    FoundTo:boolean;
    FoundCc:boolean;
    Message: TStringlist;
Begin      
    //Initialize
    ToField:='';
    CcField:='';
    FoundTo:=False;
    FoundCc:=False;
    i:=0;
    ToggleCount:=0;
        
    while ((ToggleCount<2) and (FoundTo=false) and (FoundCc=false)) do
    Begin
        ADo('ShowHeaders'); //Since this is a toggle, and I don't know what
 	 		    //the state is, I do this a maximum of twice.
        while (i<(Message.count-1)) do
        Begin
            s:=Message.strings[i];
            if s='' then break; //only scan through headers
				//(not sure why this works)
            if ((s[0]='T') and (s[1]='o') and (s[2]=':')) then 
		//should use a substring statement
            Begin
                ToField:=s;
                FoundTo:=True;
            End
            if ((s[0]='C') and (s[1]='c') and (s[2]=':')) then
            Begin
                CcField:=s;
                FoundCc:=True;
            End
        End
    End
    ADo('ReplyByEmail');
    //Just trying to see if the data can be put in the message first.
    //If this works, I'll put them in the appropriate header fields
    writeln(ToField);
    writeln(CcField);
End.
....................................................................

Thanks for any help. If this is the wrong forum, please direct me
elsewhere.


-- 
Barry
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