RAD Studio
ContentsIndex
PreviousUpNext
except.h

The following functions, macros, and classes are provided in except.h:

Name 
Description 
Header File
except.h
Syntax
extern char * _RTLENTRY __ThrowExceptionName();
#define __throwExceptionName __ThrowExceptionName()
Description
Use this global variable to get the name of a thrown exception. The output for this variable is a printable character string. 
Header File
except.h
Syntax
extern char * _RTLENTRY __ThrowFileName();
#define __throwFileName __ThrowFileName()
Description
Use this global variable to get the name of a thrown exception. The output for this variable is a printable character string.
To get the file name for a thrown exception with __throwFileName, you must compile the module with the -xp compiler option. 
Header File
except.h
Syntax
extern unsigned _RTLENTRY __ThrowLineNumber();
#define __throwLineNumber __ThrowLineNumber()
Description
Use this global variable to get the name of a thrown exception. The output for this variable is a printable character string.
To get the line number for a thrown exception with __throwLineNumber, you must compile the module with the -xp compiler option. 
Header File
except.h
Syntax
typedef void (*terminate_handler)();
terminate_handler set_terminate(terminate_handler t_func);
Description
set_terminate lets you install a function that defines the program's termination behavior when a handler for the exception cannot be found. The actions are defined in t_func, which is declared to be a function of type terminate_handler. A terminate_handler type, defined in except.h, is a function that takes no arguments, and returns void.
By default, an exception for which no handler can be found results in the program calling the terminate function. This will normally result in a call to abort. The program then ends with the message Abnormal... more 
Header File
except.h
Syntax
typedef void ( * unexpected_handler )();
unexpected_handler set_unexpected(unexpected_handler unexpected_func);
Description
set_unexpected lets you install a function that defines the program's behavior when a function throws an exception not listed in its exception specification. The actions are defined in unexpected_func, which is declared to be a function of type unexpected_handler. An unexpected_handler type, defined in except.h, is a function that takes no arguments, and returns void.
By default, an unexpected exception causes unexpected to be called. If is defined, it is subsequently called by unexpected. Program control is then turned over to the user-defined unexpected_func. Otherwise, terminate... more 
Header File
except.h
Syntax
void terminate();
Description
The function terminate can be called by unexpected or by the program when a handler for an exception cannot be found. The default action by terminate is to call abort. Such a default action causes immediate program termination.
You can modify the way that your program will terminate when an exception is generated that is not listed in the exception specification. If you do not want the program to terminate with a call to abort, you can instead define a function to be called. Such a function (called a terminate_handler) will be called... more 
Header File
except.h
Syntax
void unexpected();
Description
The unexpected function is called when a function throws an exception not listed in its exception specification. The program calls unexpected, which by default calls any user-defined function registered by set_unexpected. If no function is registered with set_unexpected, the unexpected function then calls terminate.
Return Value
None, although unexpected may throw an exception. 
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!