🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #1643

Re: Tranlation problem

#1643
From: Remy Lebeau (TeamB)
Date: Thu, 14 Dec 2006 22:54
52 lines
2658 bytes
"Roger Hemme" <rog@net.nl> wrote in message
news:4581cf08@newsgroups.borland.com...

> This is a piece of code posted by Mr. Lebeau in the discussion "Adding
> news messages to a tree" (2004). I have some problems translating this
> into Delphi-code.

    var
        Messages: TStringList;
        XOverData: TStringList;
        ArticleIndex, ByteCount, LineCount, I: Integer;
        Subject, From, MsgId, References, ExtraData: String;
        dtDate: TDateTime;
        Node: TTreeNode;
    begin
        Messages := TStringList.Create;
        try
            XOverData := TStringList.Create;
            try
                // use whatever article indexes you are actually downloading
                IdNNTP1.XOVER(IntToStr(IdNNTP1->MsgLow) + '-' +
IntToStr(IdNNTP1.MsgHigh), XOverData);

                TreeView1.Items.BeginUpdate;
                try
                    for I := 0 to XOverData.Count-1 do
                    begin
                        IdNNTP1.ParseXOVER(XOverData[I], ArticleIndex,
Subject, From, dtDate, MsgId, References, ByteCount, LineCount, ExtraData);

                        Node := FindParentMessage(Messages, References);
                        if Assigned(Node) then
                            Node := TreeView1.Items.AddChild(Node, Subject)
                        else
                            Node := TreeView1.Items.Add(nil, Subject);

                        Messages.AddObject(MsgId, Node);
                    end;
                finally
                    TreeView1.Items.EndUpdate;
                end;
            finally
                XOverData.Free;
            end;
        finally
            Messages.Free;
        end;
    end;


Gambit
Technical Details
Message-ID: <4581d5f4$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news1.google.com!news.maxwell.syr.edu!newsgate.cistron.nl!xs4all!newsfeed.bit.nl!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4581cf08@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,882d665e9542934a
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.internet.socket
References: <4581cf08@newsgroups.borland.com>
Subject: Re: Tranlation problem
Date: Thu, 14 Dec 2006 14:54:15 -0800
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.34.171
Message-ID: <4581d5f4$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1166136820 75.83.34.171 (14 Dec 2006 14:53:40 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news1.google.com!news.maxwell.syr.edu!newsgate.cistron.nl!xs4all!newsfeed.bit.nl!news.germany.com!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail