Internet Direct (Indy)
Home
PreviousUpNext
TIdNNTP.GetNewNewsList Method (string, TDateTime, boolean, string)

Retrieves a list of message identifiers for new articles.

Pascal
procedure GetNewNewsList(
    ANewsgroups: string; 
    ADate: TDateTime; 
    AGMT: boolean; 
    ADistributions: string
); overload;
Parameters 
Description 
ANewsgroups 
Name of the newsgroup to be examined.
 
ADate 
Previous data and time the newsgroup list was retrieved.
 
AGMT 
Time is expressed in GMT.
 
ADistributions 
Optional list of distribution patterns. 

GetNewNewsList is an overloaded procedure in TIdNNTP used to retrieve a list of message identifiers posted or received in a specified newsgroup since a given date and time. 

ANewsgroups can contain a value that identifies the name or search patterns used in locating newsgroups to be included in the list of new message identifiers. ANewsgroups can contain the '*' (asterisk) indicating that the search will match any newsgroup name matching fixed portions of the search value. Multiple newsgroup names or search patterns may be specified as a comma-delimited list. 

For instance, 'net.micro*' will match 'net.micro.wombat', 'net.micro.apple', etc. In addition, 'net.*.unix' would match newsgroups with names like 'net.wombat.unix' and 'net.whocares.unix'. 

If only an asterisk character is given in ANewsgroups, all newsgroups will be searched for new message identifiers. If no asterisk appears in a given newsgroup name, only the specified newsgroup will be searched for new articles. 

ANewsgroups may also contain an exclamation point ('!') character used to negate a match, and omit newsgroups matching the specified names or search patterns. For example, a newsgroups specification of 'net.*,mod.*,!mod.map.*' would specify that all groups starting with 'net.' or 'mod.' except newsgroups starting with 'mod.map.' would be matched. If used, the exclamation point must appear as the first character of the given newsgroup name or pattern. 

ADate represents the date and time to be used in determining which message identifiers are included in the list of new articles. 

When AGMT is True, the value in ADate is based on Greenwich Mean Time or Universal Time Coordinated (0 meridian). When AGMT is False, the value in ADate represents a value for the local time-zone. 

ADistributions is an optional string containing a comma-delimited list of newsgroups or prefixes to be used as a filter when retrieving the list new articles. Only those articles which have at least one newsgroup belonging to the list of distributions will be returned in the list of new articles. 

GetNewNewsList relies on the OnNewNewsList event handler to signal receipt of response lines from the NNTP server. Applications must assign a procedure to the OnNewNewsList event handler to allow responsing to the event notification. GetNewNewsList will raise an EIdNNTPNoOnNewNewsList exception if the OnNewNewsList event handler property is unassigned. 

GetNewNewsList sends the NNTP NEWNEWS command using the arguments supplied in ANewsgroups, ADate, AGMT, and ADistributions. GetNewNewsList reads the response lines from the NNTP server, where each line contains a single message identifer for an NNTP article and the final line consisting of one period ('.') that terminates the list. GetNewNewsList may return only the list terminator character sequence when there are no new articles for the specified criteria. 

OnNewNewsList is signalled for each response line from the NNTP server containing a message identifier, or until OnNewNewsList indicates that additional message identifiers cannot be processed. 

Use GetNewGroupsList to process newsgroups added to the server since a specified date and time. 

Implementors are cautioned to adhere to the 512 character limit for the length of NNTP commands.

Exceptions 
Description 
With the message RSNNTPNoOnNewNewsList

SendCmd GetNewNewsList OnNewNewsList TEventNewNewsList EIdNNTPNoOnNewNewsList

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.