🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Tranlation problem

#1642
From: Roger Hemme
Date: Thu, 14 Dec 2006 22:25
56 lines
2699 bytes
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. (I'm not very familiar with C++)
Espesially the: " if(node) " - part.
If(node) /what/?

(PS - I don't need help with the FindParentMessage-function earlier i 
that thread)

TStringList *Messages = new TStringList;
     try
     {
         TStringList *XOverData = new TStringList;
         try
         {
             int ArticleIndex, ByteCount, LineCount;
             AnsiString Subject, From, MsgId, References, ExtraData;
             TDateTime dtDate;
             TTreeNode *Node;

             // use whatever article indexes you are actually downloading
             IdNNTP1->XOVER(AnsiString(IdNNTP1->MsgLow) + "-" +
	    AnsiString(IdNNTP1->MsgHigh), XOverData);

             TreeView1->Items->BeginUpdate();
             try
             {
                 for(int x = 0; x < XOverData->Count; ++x)
                 {
                   									 
IdNNTP1->ParseXOVER(XOverData->Strings[x],ArticleIndex,
		Subject, From, dtDate, MsgId, References, ByteCount, 				LineCount, 
ExtraData);

                     Node = FindParentMessage(Messages, References);
                     if( Node )
                         Node = TreeView1->Items->AddChild(Node,Subject);
                     else
                         Node = TreeView1->Items->Add(NULL, Subject);
                     }
                     Messages->AddObject(MsgId, Node);
                 }
             }
             __finally {
                 TreeView1->Items->EndUpdate();
             }
         }
         __finally {
             delete XOverData;
         }
     }
     __finally {
         delete Messages;
     }

Thanks in advance!
Technical Details
Message-ID: <4581cf08@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,882d665e9542934a,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Thu, 14 Dec 2006 23:25:17 +0100
From: Roger Hemme <rog@net.nl>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: nb, no, nn
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Tranlation problem
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 85.164.106.48
Message-ID: <4581cf08@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1166135048 85.164.106.48 (14 Dec 2006 14:24:08 -0700)
Lines: 56
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail