OnError Event

This event is triggered when a line-status error occurs.

Syntax

Delphi
OnError(Sender: TObject; Error: FTSPCCommErrors);
BCBuilder
OnError(TObject * Sender, FTSPCCommErrors Error);

Parameters

Sender

Event source.

Error

A line-status error type.

Code Example

//
// Event handler by example of CTS signal event handler
//
procedure TForm1.FTSPCControl1Cts(Sender: TObject);
begin
	try
	if FTSPCControl1.Cts then
		begin
			// Todo: add your code
		end;
	except
		on e:FTSPCException do
		begin
			application.MessageBox(PChar('Error: ' + 
				inttostr(e.ErrorCode) + ' - ' +
				e.ErrorSource), 'Error!', MB_OK + 
				MB_ICONERROR);
		end;
	end;
end;