Board index » cppbuilder » try, catch

try, catch


2003-07-22 08:18:53 PM
cppbuilder82
Hello,
hope someone can help me here ;) I have no idea
about the try and catch commands and I need it
in my programm:
try
{
TCPClient->Connect();
}
if this is sucessfull I want to call the function
a() for example, if not sucessfull ("Socket-error
# 10061") the function b()
how to do this?
best regards,
Philipp
 
 

Re:try, catch

Philipp Arndt wrote:
Quote
Hello,

hope someone can help me here ;) I have no idea
about the try and catch commands and I need it
in my programm:

try
{
TCPClient->Connect();
}

if this is sucessfull I want to call the function
a() for example, if not sucessfull ("Socket-error
# 10061") the function b()

how to do this?
use:
try {
TCPClient->Connect();
}
catch (...)
{
ShowMessage("Mööp");
return;
}
lstMain->Items->Add(TCPClient->ReadLn());
TCPClient->Disconnect();
regards,
Tobias
--
GSM Development Crew
www.gsm-dev.com
 

Re:try, catch

"Tobias Hauser wrote:
Quote
use:

try {
TCPClient->Connect();
}
catch (...)
{
ShowMessage("Mööp");
return;
}

lstMain->Items->Add(TCPClient->ReadLn());
TCPClient->Disconnect();
thanks!
regards,
Philipp
 

{smallsort}