Article View: borland.public.cppbuilder.internet.socket
Article #1644Re: Tranlation problem
From: Roger Hemme
Date: Thu, 14 Dec 2006 23:28
Date: Thu, 14 Dec 2006 23:28
57 lines
2856 bytes
2856 bytes
Remy Lebeau (TeamB) skrev:
> "Roger Hemme" <rog@net.nl> wrote in message
> news:4581cf08@newsgroups.borland.com...
>
>
> var
> Messages: TStringList;
> XOverData: TStringList;
> ArticleIndex, ByteCount, LineCount, I: Integer;
> Subject, From, MsgId, References, ExtraData: String;
> dtDate: TDateTime;
> Node: TTreeNode;
> begin......
Thank you very much, Gambit! But...what i'm trying to do isn't working,
so i wonder if the translation i have of the " FindParentMessage " -
function is wrong? Here it is:
function FindParentMessage(Messages: TStrings; References: String):
TTreeNode;
var pFirst: PChar;
pStop: PChar;
pStart: PChar;
pEnd: PChar;
MsgIdToFind: String;
idx: Integer;
begin
result:=nil;
if not(Length(References) = 0) or (Messages = nil) then
begin
pFirst:=PChar(References);
pStop:=pFirst + 2;
pStart:=AnsiLastChar(References);
pEnd:=pStart;
while (pEnd > pStop) do
begin
while ((pEnd > pStop) and (pEnd^ <> '>')) do Dec(pEnd);
if (pEnd = pStop) then break;
pStart:=(pEnd - 1);
while ((pStart >= pFirst) and (pStart <> '<')) do Dec(pStart);
if (pStart < pFirst ) then break;
SetString(MsgIdToFind, pStart, pEnd - pStart + 1);
for idx:=Pred(Messages.Count) downto 0 do
begin
if (Messages[idx] = MsgIdToFind) then
begin
result:=TTreeNode(Messages.Objects[idx]);
exit;
end;
end;
pEnd:=(pStart - 1);
end;
end;
end;
Technical Details
Message-ID:
<4581DE1B.7050909@net.nl>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4581cf08@newsgroups.borland.com> <4581d5f4$2@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 Message-ID: <4581DE1B.7050909@net.nl> Date: Fri, 15 Dec 2006 00:28:27 +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 To: "Remy Lebeau (TeamB)" <no.spam@no.spam.com> Subject: Re: Tranlation problem References: <4581cf08@newsgroups.borland.com> <4581d5f4$2@newsgroups.borland.com> In-Reply-To: <4581d5f4$2@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 85.164.106.48 X-Trace: newsgroups.borland.com 1166138837 85.164.106.48 (14 Dec 2006 15:27:17 -0700) Lines: 57 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail