.. highlightlang:: us .. index:: GetExceptionCode .. _getexceptioncode: GetExceptionCode ================ .. us.tag GetExceptionCode ENGLISH Programming.Exceptions :ref:`GetExceptionCode` returns the current exception code. .. function:: nCode = GetExceptionCode() .. us.return **Return Value** *nCode* is the code (number) of an exception. The exception codes are defined in the file :file:`uniplot\\script\\alias.ic` (e.g. ``#define ICERR_INTERRUPT 0xE000002F``). .. us.comment **Comment** This function can only be used in try-except blocks (see UniScript User Manual). The try-except blocks must be inside a function. .. us.example **Example** :: def Test() { try { // Create Exception a = 1 + "a"; } except(GetExceptionCode() == ICERR_OPERATOR_TYPE) { MessageBox("Exception ICERR_OPERATOR_TYPE"); } } .. seealso:: :ref:`overview-programming`, :ref:`GetExceptionInfo`, :ref:`GetExceptionString` :sub:`id-863421`