Topic Path: Pending > TIdNNTP.GetArticle@Integer@TStream
ContentsIndexHome
PreviousUpNext
TIdNNTP.GetArticle@Integer@TStream

Retrieves a complete NNTP article.

Parameters 
Description 
AMsgNo 
Index number for the article.
 
AMsg 
Stream where the complete article should be stored. 

Boolean - True if the article is successfully retrieved.

GetArticle is an overloaded Boolean function in TIdNNTP used to retrieve a complete NNTP article including the headers and body. 

GetArticle calls SendCmd to issue the NNTP ARTICLE command used to perform article retrieval using a numeric message number, a message identifier string, or the NNTP current article pointer. 

The overloaded GetArticle functions also provide for storing the contents of the selected article in a TIdMessage instance, as text in a TStrings instance, or as values written to a TStream descendant. 

When using GetArticle with a numeric article index, the NNTP current article pointer is set to the indicated article. 

When using GetArticle with a message identifier string, the NNTP current article pointer is NOT set to the indicated article. 

When a TIdMessage instance is used as the destination, GetArticle calls ReceiveHeader and ReceiveBody using AMsg as an argument. When TStrings or TStream are used as the destination, GetArticle calls Capture using AMsg as an argument. 

The return value for GetArticle is True when the numeric response from SendCmd is 220. GetArticle will return False if any of the following responses are received: 

 

Code 
Message 
412 
no newsgroup has been selected 
420 
no current article has been selected 
423 
no such article number in this group 
430 
no such article found 

 

Use SelectGroup to select the active newsgroup prior to calling GetArticle. 

Use SelectArticle to set the current article pointer for the active newsgroup. 

Use GetNewNewsList to get a list of articles added since a specified date and time. 

Use GetHeader to retrieve the headers for a specific NNTP article. Use GetBody to retrieve the body text for a specific NNTP article.

TIdMessage SelectGroup SelectArticle GetNewNewsList GetHeader GetBody GetArticle

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.