|Posted by:||bluewolf (bluewo…@yournamehere.com)|
|Date:||Sun, 9 Nov 2003|
I want to make a news program that scan's a list of news servers and gets
group counts on a list of groups then creates stats on the different news
servers with the groups.
My problem is I have a middle to low programmer knowlegde and don't know
how to use the try.. except.. functions and indy keeps raising an
exception when it can't connect to a server and when the timeout happens.
I would like some information on how to handle the exceptions, and in the
exception how to set a varible saying that the server is unreachable or
it was a connection timedout.
I have this, but don't know how to setup the class for the execption.
//?? would this be right
eMyStatsConnectionError = EIdSocketErrror(class);
ConnectErr : Boolean;
procedure TForm1.Button1Click(Sender: TObject);
// 'm' left out to raise exception.
IdNNTP1.Port := 119;
ListBox1.Items.Add('Message Count: '+IntToStr(idNNTP1.MsgCount));
ListBox1.Items.Add('Message Hi: '+IntToStr(idNNTP1.MsgHigh));
ListBox1.Items.Add('Message Low: '+IntToStr(idNNTP1.MsgLow));
on e:EMyStatsConnectionError do connecterr := false;