Advertisement
Gov_777

try-catch(...)____finally

Jun 26th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. bool TForm1::CheckShararam(void) {
  2.     TIdTCPClient* TCP = new TIdTCPClient(NULL);
  3.     try {
  4.         try {
  5.             TCP->Host = "*site.com";
  6.             TCP->Port = 80;
  7.             TCP->ConnectTimeout = 1000;
  8.             TCP->Connect();
  9.             return TCP->Connected();
  10.         }
  11.         catch (...) {
  12.             ShowMessage("catch");
  13.             return false;
  14.         }
  15.     }
  16.     __finally {
  17.         delete TCP;
  18.         ShowMessage("finally");
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement