Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tey except statements 2

Status
Not open for further replies.

GCTIberica

Programmer
Jun 20, 2003
30
ES
I am writing an application for TIdTCPClient. However, there is a very strange thing happening with my code. I have connected the TCPClient etc


try
FTCPClient.WriteLn(envio);
try
respuesta := FTCPClient.ReadLn(#$A,5000);
except
realizado := false;
end;
if FTCPClient.ReadLnTimedOut then
realizado := false
else
realizado := (respuesta <> '');
except
realizado := false;
end;



At first I had one try-except statement, but later changed it to avoid jumping back to the block that called this block.

When it gets to the first try, it jumps back to the block that called it, and I have no idea why, or how to fix it. It is all very strange. Has anyone ever came across this before?

Thanks

Nora
 
Use try..except this way to see what the error is:
Code:
  try
    FTCPClient.WriteLn(envio);
  except
[blue]
Code:
    On E:Exception do ShowMessage (E.Message);
[/color]
Code:
  end;
 
Nothing is handling the exception so it's still there--and thus the stack is unwound to the next handler.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top