-
Exception handling
Hi there!
I've got to make some error checking, but I got stuck at exception handling.
The problem is the following:
I'd like to make this
temp=StrToInt(Ansistring text)
I figured out that it works kinda like this to perform exception handling:
code:
try
{
temp=StrToInt(txtBox1hossz->Text);
}
catch (const exception& e)
{
ShowMessage("Error in given data!");
goto finish;
}
When I try to compile this code part, I get an error "Catch statement missing". What did I do wrong?
Thanks
Han
-
If you're just catching a general exeption and not throwing in your code, then just use 3 dots within the catch
-
Thanks!
It seems to be working in my code.
Han