try except

edited 8:10PM in FastScript
How do you use Try/Exception and capture exceptions?

Seems "On E:Exception " is not right.

Thanks,
Brian

P.S. I'd like to see 'STDOUT' implemented to a something like a TStringList ,
similar to ErrorMsg but could capture output from a "Method call"
and output at the end of the script.

Comments

  • edited 8:10PM
    "on E: Exception" is not supported.
  • Hi;

    i know that "on E: Exception" is not supported, but is there any way to 'capture' the exception message?

    something like that:

    procedure GenerateError;
    begin
    try
    ShowMessage(StrToInt('A'));
    except
    ShowMessage(ErrorMessage); // it exist an variable or function ErrorMessage ?
    end;
    end;
  • edited 8:10PM
    No, there is no such variable, you can't show error message in the script.
  • edited 8:10PM
    You can create a user function and control the Try..Except throug Delphi...

    regards.

Leave a Comment