Blocked Port

If my programm is trying to open a TCP port that is allready in use I get an error message. how do I remove that message and maybe replase it with one off my own?
SwOoPeAsked:
Who is Participating?
 
delphiexpertConnect With a Mentor Commented:
Well I assume that an exception is being generated.

solution:

try
tcp.open;
except
ShowMessage('Error, port is in use!');
end;
0
 
SwOoPeAuthor Commented:
It wont aprove the use off  'except'

I get: 'END' expected but 'except' found

Any solution?? I need this to work if I'll add any ports.
0
 
SwOoPeAuthor Commented:
By the way, Im using Delphi 4 Client/Server
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
SwOoPeAuthor Commented:
Sorry my fault. I forgot to the 'try' part, but it still dident work.

I still get the usual error mesage from
ScktComp.pas
0
 
EpsylonCommented:
If you run this code inside Delphi you will still raise the exception, but if you just run the exe, it won't...
0
 
delphiexpertCommented:
. unless you disable "break on exception" under Environment options|debugging. (that's where it is in Delphi 3 anyway)
0
 
SwOoPeAuthor Commented:
Thanks u were right
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.