System.SysUtils.Exception.ToString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function ToString: string; override;

C++

virtual System::UnicodeString __fastcall ToString(void);

Properties

Type Visibility Source Unit Parent
function public
System.SysUtils.pas
System.SysUtils.hpp
System.SysUtils Exception

Description

Returns a string containing the exception message.

For example, the following code prints "This is my exception" to the standard output:

myException := Exception.Create('This is my exception');
Writeln(myException.toString());
Exception* myException = new Exception("This is my exception");
std::wcout << myException->ToString().c_str();
Retrieved from "https://docwiki.embarcadero.com/Libraries/Tokyo/e/index.php?title=System.SysUtils.Exception.ToString&oldid=595379"