Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Jan : Re: EListError - Index out of bound [0]

www.cryer.info
Managed Newsgroup Archive

Re: EListError - Index out of bound [0]

Subject:Re: EListError - Index out of bound [0]
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Mon, 29 Jan 2007 00:10:36

"John Herbster" <herb-sci1_AT_sbcglobal.net> wrote in message
news:45bd070c$1@newsgroups.borland.com...

> (1) checked value of
>   IdMessage1.MessageParts.Items.Count = 0

The correct property is IdMessage1.MessageParts.Count.

> (2) tried
>   Memo1.Lines.Text :=
>       (IdMessage1.MessageParts.Items[0] as TIdText).Body.Text

That is no different from the code John is already using, and thus
will have the same error.  Using TIdText(...) and (.. as TIdText) do
the exact same thing.  The only difference is that 'as' will throw a
different exception if the cast fails, whereas TIdText(...) will not.
But the error in question is coming from Items[0], so the code is not
getting far enough to perform a cast either way.


Gambit

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive