#ifndef _ERROR_H
#define _ERROR_H

typedef int ERRCODE;

/* ERROR CODES ==============================================================*/

/* Numbers from 0 to 9 are reserved for values with no message */
#define ER_OKAY                         (    0)
#define ER_EXIT                         (    1)
#define ER_STOP                         (    2)
#define ER_OFF                          (    3)
#define ER_PRGM_STOP                    (    4)

#define ER_NO_MSG                       (    9)

/* ER_FUNC_DID_NOT_RETURN_VALUE_MSG[] = "A function did not return a value" */
#define ER_FUNC_DID_NOT_RETURN_VALUE    (  10)

/* ER_TEST_NOT_TRUE_OR_FALSE_MSG[] = "A test did not resolve to TRUE or FALSE" */
#define ER_TEST_NOT_TRUE_OR_FALSE       (  20)

/* ARG_CANNOT_BE_FOLDER_MSG[] = "Argument cannot be a folder name" */
#define ER_ARG_CANNOT_BE_FOLDER         (  30)

/* ER_ARGUMENT_MSG[] = "Argument error" */
#define ER_ARGUMENT                     (  40)

/* ARG_MISMATCH_MSG[] = "Argument mismatch" */
#define ER_ARG_MISMATCH                 (  50)

/* EXPECTED_BOOLEAN_ERR_MSG[] = "Argument must be a boolean expression or integer" */
#define EXPECTED_BOOL_OR_AGG_ERROR      (  60)

/* ARG_MUST_BE_DECIMAL_MSG[] = "Argument must be a decimal number" */
#define ER_ARG_MUST_BE_DECIMAL          (  70)

/* ARG_MUST_BE_LABEL_MSG[] = "Argument must be a label name" */
#define ER_ARG_MUST_BE_LABEL            (  80)

/* ER_ARGUMENT_MUST_BE_LIST_MSG[] = "Argument must be a list" */
#define ER_ARGUMENT_MUST_BE_LIST        (  90)

/* ER_ARG_MUST_BE_MATRIX_MSG[] = "Argument must be a matrix" */
#define ER_ARG_MUST_BE_MATRIX           ( 100)

/* ER_ARG_MUST_BE_PIC_MSG[] = "Argument must be a Pic" */
#define ER_ARG_MUST_BE_PIC              ( 110)

/* ER_ARG_MUST_BE_PIC_OR_STR_MSG[] = "Argument must be a Pic or string" */
#define ER_ARG_MUST_BE_PIC_OR_STR       ( 120)

/* ER_ARG_MUST_BE_STRING_MSG[] = "Argument must be a string" */
#define ER_ARG_MUST_BE_STRING           ( 130)

/* EXPECTED_VAR_ERR_MSG[] = "Argument must be a variable name" */
#define EXPECTED_VAR_ERROR              ( 140)

/* ER_ARG_MUST_BE_EMPTY_FOLDER_MSG[] = "Argument must be an empty folder name" */
#define ER_ARG_MUST_BE_EMPTY_FOLDER     ( 150)

/* EXPECTED_ALGEBRAIC_ERR_MSG[] = "Argument must be an expression" */
#define EXPECTED_ALGEBRAIC_ERROR        ( 160)

/* ER_ASAP_TOO_LONG[] = "ASAP or Exec string too long" */
#define ER_ASAP_TOO_LONG                ( 161)

/* ER_ATTRIBUTE_NOT_FOUND_MSG[] = "Attribute %s of object %s not found" */
#define ER_ATTRIBUTE_NOT_FOUND          ( 163)

/* ER_BATT_LOW_MSG[] = "Batteries too low for sending or receiving" */
#define ER_BATT_LOW                     ( 165)

/* ER_BOUND_MSG[] = "Bound" */
#define ER_BOUND                        ( 170)

/* ER_BREAK_MSG[] = "Break" */
#define ER_BREAK                        ( 180)

/* ER_CHECKSUM_MSG[] = "Checksum error" */
#define ER_CHECKSUM                     ( 185)

/* ER_CIRCULAR_DEFINITION_MSG[] = "Circular definition" */
#define ER_CIRCULAR_DEFINITION          ( 190)

/* INVALID_SUCH_THAT_ERROR_MSG[] = "Constraint expression invalid" */
#define INVALID_SUCH_THAT_ERROR         ( 200)

/* ER_DATA_TOO_BIG_MSG[] = "Data too big to save. Resize variable. */
#define ER_DATA_TOO_BIG                 ( 205)

/* ER_DATATYPE_MSG[] = "Data type" */
#define ER_DATATYPE                     ( 210)

/* ER_DEPENDENT_LIMIT_MSG[] = "Dependent limit" */
#define ER_DEPENDENT_LIMIT              ( 220)

/* ER_DIFF_EQ_SETUP_MSG[] = "Diff Eq setup" */
#define ER_DIFF_EQ_SETUP                ( 225)     /* SPAM error */

/* ER_DIMENSION_MSG[] = "Dimension" */
#define ER_DIMENSION                    ( 230)
#define ER_NOT_ENOUGH_ELEMENTS          ER_DIMENSION + 1

/* NON_CONFORMING_LISTS_ERR_MSG[] = "Dimension mismatch" */
#define NON_CONFORMING_LISTS_ERROR      ( 240)

/* ZERO_DIV_ERR_MSG[] ="Divide by zero" */
#define FIRST_ZERO_DIVIDE               ( 250)
#define ER_DIVBY0                       FIRST_ZERO_DIVIDE + 1

/* ER_DOMAIN_MSG[] = "Domain error" */
#define FIRST_DOMAIN_ERR                ( 260) /* DO NOT CHANGE THIS VALUE */
#define ER_DOMAIN FIRST_DOMAIN_ERR              /* UNLESS YOU CHANGE IT IN  */
/* MATHUTIL.S               */

/* ER_DUPLICATE_VAR_NAME_MSG[] = "Duplicate variable name" */
#define ER_DUPLICATE_VAR_NAME           ( 270)

/* ER_ELSEIF_WITHOUT_IF_MSG[] = "Else and ElseIf invalid outside of If..EndIf block" */
#define FIRST_ELSEIF_ELSE_ERR           ( 280)
#define ER_ELSEIF_WITHOUT_IF FIRST_ELSEIF_ELSE_ERR + 1
#define ER_ELSE_WITHOUT_IF   FIRST_ELSEIF_ELSE_ERR + 2

/* ER_ENDTRY_WITHOUT_ELSE_MSG[] = "EndTry is missing the matching Else statement" */
#define ER_ENDTRY_WITHOUT_ELSE          ( 290)

/* ER_EXCESSIVE_ITERATION_MSG[] = "Excessive iteration" */
#define ER_EXCESSIVE_ITERATION          ( 295)

/* EXPECTED_2OR3_ELEMENTS_ERR_MSG[] = "Expected 2 or 3-element list or matrix" */
#define EXPECTED_2OR3_ELEMENTS_ERROR    ( 300)

/* ER_EXPIRED_MSG[] = "Expired OS"   */
#define ER_EXPIRED                      ( 305)

/* ER_APP_EXT_NOT_FOUND_MSG[] = "Flash application extension not found" */
#define ER_APP_EXT_NOT_FOUND            ( 307)

/* ER_APP_NOT_FOUND_MSG[] = "Flash application not found" */
#define ER_APP_NOT_FOUND                ( 308)

/* INVALID_NSOLVE_ARG1_ERROR_MSG[] = "First argument of nSolve must be a univariate equation" */
#define INVALID_NSOLVE_ARG1_ERROR       ( 310)

/* INVALID_SOLVE_ARG1_ERROR_MSG[] = "First argument of solve or cSolve must be an equation or inequality" */
#define INVALID_SOLVE_ARG1_ERROR        ( 320)

/* ER_FOLDER_MSG[] = "Folder" */
#define ER_FOLDER                       ( 330)

/* ER_FUNCS_IN_DIFF_EQ_MSG[] = "Graph functions y1(x)...y99(x) not available
in Diff Equations mode"  */
#define ER_FUNCS_IN_DIFF_EQ             ( 335)

/* ER_INCONSISTENT_UNITS_MSG[] = "Inconsistent units" */
#define ER_INCONSISTENT_UNITS           ( 345)

/* ER_INVALID_SUBSCRIPT_MSG[] = "Index out of range" */
#define ER_INVALID_SUBSCRIPT            ( 350)

/* ER_INVALID_INDIR_STRING_MSG[] = "Indirection string is not a valid variable name" */
#define FIRST_INVALID_INDIR             ( 360)
#define ER_INVALID_INDIR_STRING			FIRST_INVALID_INDIR + 1
#define ER_INDIR_STRING_NOT_VARNAME     FIRST_INVALID_INDIR + 2
#define ER_INDIR_STRING_NOT_FUNNAME     FIRST_INVALID_INDIR + 3

#if defined(DISCOVERY) || defined(PET)
/* ER_INVALID_INDEXING_MSG[] = "Invalid indexing. Use [...] brackets." */
#define ER_INVALID_INDEXING             ( 370)
#endif

/* ER_INVALID_ANS_MSG[] = "Invalid ans()" */
#define ER_INVALID_ANS                  ( 380)

/* ER_ILLEGAL_ASSIGNMENT_MSG[] = "Invalid assignment" */
#define ER_ILLEGAL_ASSIGNMENT           ( 390)

/* ER_ILLEGAL_ASSIGNMENT_VALUE_MSG[] = "Invalid assignment value" */
#define ER_ILLEGAL_ASSIGNMENT_VALUE     ( 400)

/* ER_INVALID_AXES_MSG[] = "Invalid axes" */
#define ER_INVALID_AXES                 ( 405)    /* SPAM error */

/* ER_ILLEGAL_COMMAND_MSG[] = "Invalid command" */
#define ER_ILLEGAL_COMMAND              ( 410)

/* ER_INVALID_FOLDER_NAME_MSG[] = "Invalid folder name" */
#define ER_INVALID_FOLDER_NAME          ( 420)

/* ER_GRAPH_MODE_MSG[] = "Invalid for the current mode settings" */
#define ER_GRAPH_MODE                   ( 430)

/* ER_INVALID_GUESS_MSG[] = "Invalid guess" */
#define ER_INVALID_GUESS                                ( 435)

/* ER_INVALID_IMPLIED_MULT_MSG[] = "Invalid implied multiply" */
#define ER_INVALID_IMPLIED_MULT         ( 440)

/* ER_ILLEGAL_IN_FUNC_MSG[] = "Invalid in a function or current expression" */
#define FIRST_ILLEGAL_IN_FUNC           ( 450)
#define ER_ILLEGAL_IN_FUNC FIRST_ILLEGAL_IN_FUNC

/* ER_ILLEGAL_IN_CUSTOM_MSG[] = "Invalid in Custom..EndCustm block" */
#define ER_ILLEGAL_IN_CUSTOM            ( 460)

/* ER_ILLEGAL_IN_DIALOG_MSG[] = "Invalid in Dialog..EndDlog block" */
#define ER_ILLEGAL_IN_DIALOG            ( 470)

/* ER_ILLEGAL_IN_TOOLBAR_MSG[] = "Invalid in ToolBar..EndTBar block" */
#define ER_ILLEGAL_IN_TOOLBAR           ( 480)

/* ER_INVALID_IN_TRY_MSG[] = "Invalid in Try..EndTry" */
#define FIRST_INVALID_IN_TRY_ERR       ( 490)
#define ER_CANNOT_EXIT_FROM_TRY     FIRST_INVALID_IN_TRY_ERR + 1
#define ER_CANNOT_CYCLE_FROM_TRY    FIRST_INVALID_IN_TRY_ERR + 2
#define ER_CANNOT_GOTO_FROM_TRY     FIRST_INVALID_IN_TRY_ERR + 3
#define ER_CANNOT_GOTO_INTO_TRY     FIRST_INVALID_IN_TRY_ERR + 4

/* ER_INVALID_LABEL_MSG[] = "Invalid label" */
#define ER_INVALID_LABEL                ( 500)

/* ER_INVALID_LIST_OR_MATRIX_MSG[] = "Invalid list or matrix" */
#define ER_INVALID_LIST_OR_MATRIX       ( 510)

/* ER_INVAL_OUTSIDE_TB_CM_MSG[] = "Invalid outside Custom..EndCustm or ToolBar..EndTBar blocks" */
#define ER_INVAL_OUTSIDE_TB_CM          ( 520)

/* ER_INVAL_OUTSIDE_DG_TB_CM_MSG[] = "Invalid outside Dialog..EndDlog, Custom..EndCustm, or ToolBar..EndTBar blocks" */
#define ER_INVAL_OUTSIDE_DG_TB_CM       ( 530)

/* ER_INVALID_OUTSIDE_DIALOG_MSG[] = "Invalid outside Dialog..EndDlog block" */
#define ER_INVALID_OUTSIDE_DIALOG       ( 540)

/* ER_MUST_BE_IN_PRGM_OR_FUNC_MSG[] = "Invalid outside function or program" */
#define ER_MUST_BE_IN_PRGM_OR_FUNC      ( 550)

/* ER_INVALID_OUTSIDE_LOOP_MSG[] = "Invalid outside Loop..EndLoop, For..EndFor, or While..EndWhile blocks" */
#define FIRST_OUTSIDE_LOOP              ( 560)
#define ER_CYCLE_NOT_IN_LOOP            FIRST_OUTSIDE_LOOP + 1
#define ER_EXIT_NOT_IN_LOOP             FIRST_OUTSIDE_LOOP + 2

/* INVALID_PATHNAME_ERR_MSG[] = "Invalid pathname" */
#define INVALID_PATHNAME_ERROR          ( 570)

/* INVALID_POLAR_COMPLEX_MSG[] = "Invalid polar complex" */
#define ER_INVALID_POLAR_COMPLEX        ( 575)

/* ER_ILLEGAL_PRGM_REF_MSG[] = "Invalid program reference" */
#define ER_ILLEGAL_PRGM_REF             ( 580)

/* ER_INVALID_RELO_DATA_MSG[] = "Invalid relocation data in ASM program" */
#define ER_INVALID_RELO_DATA            ( 585)

/* INVALID_SYNTAX_BLOCK_MSG[] = "Invalid syntax block" */
#define ER_INVALID_SYNTAX_BLOCK         ( 590)

/* ER_INVALID_TABLE_MSG[] = "Invalid table" */
#define ER_INVALID_TABLE                ( 600)

/* ER_INVALID_USE_OF_UNITS_MSG[] = "Invalid use of units" */
#define ER_INVALID_USE_OF_UNITS         ( 605)

/* ER_INVALID_LOCAL_DECLARATION_MSG[] = "Invalid variable name in a Local statement" */
#define ER_INVALID_LOCAL_DECLARATION    ( 610)

/* EXPECTED_VAR_OR_FUNC_ERR_MSG[] = "Invalid variable or function name" */
#define EXPECTED_VAR_OR_FUNC_ERROR      ( 620)

/* ER_INVALID_VAR_REF_MSG[] = "Invalid variable reference" */
#define ER_INVALID_VAR_REF              ( 630)

/* ER_INVALID_VECTOR_SYNTAX_MSG[] = "Invalid vector syntax" */
#define ER_INVALID_VECTOR_SYNTAX        ( 640)

/* ER_LINK_IO_MSG[] = "Link transmission" */
#define ER_LINK_IO                      ( 650)

/* ER_MAT_NOT_DIAGONALIZABLE_MSG[] = "Matrix not diagonalizable" */
#define ER_MAT_NOT_DIAGONALIZABLE       ( 665)

/* MEM_EXHAUST_ERR_MSG[] = "Memory" */
#define FIRST_MEMORY_ERROR              ( 670)
#define ER_MEMORY						FIRST_MEMORY_ERROR + 1
#define MEMORY_EXHAUSTION_ERROR         FIRST_MEMORY_ERROR + 2
#define ESTACK_OVERFLOW_ERROR           FIRST_MEMORY_ERROR + 4
#define ER_STACK_VIO                    ( 673) /* DO NOT CHANGE THIS VALUE  */
/* UNLESS YOU ALSO CHANGE IT */
/* IN INTS.S                 */

/* EXPECTED_LPAR_ERR_MSG[] = "Missing (" */
#define EXPECTED_LPAR_ERROR             ( 680)

/* EXPECTED_RPAR_ERR_MSG[]= "Missing )" */
#define EXPECTED_RPAR_ERROR             ( 690)

/* EXPECTED_DOUBLE_QUOTE_ERR_MSG[] = "Missing \"" */
#define EXPECTED_DOUBLE_QUOTE_ERROR     ( 700)

/* EXPECTED_RIGHT_BRACKET_ERR_MSG[] = "Missing ]" */
#define EXPECTED_RIGHT_BRACKET_ERROR    ( 710)

/* EXPECTED_RIGHT_BRACE_ERR_MSG[] = "Missing }" */
#define EXPECTED_RIGHT_BRACE_ERROR      ( 720)

/* ER_INVALID_BLOCK_STRUCTURE[] = "Missing start or end of block syntax" */
#define ER_INVALID_BLOCK_STRUCTURE      ( 730)

/* ER_MISSING_THEN_MSG[] = "Missing Then in the If..EndIf block" */
#define ER_MISSING_THEN                 ( 740)

/* ER_NOT_FUNC_OR_PRGM_MSG[] = "Name is not a function or program" */
#define ER_NOT_FUNC_OR_PRGM             ( 750)

/* ER_NO_FUNCS_SEL_MSG[] = "No functions selected" */
#define ER_NO_FUNCS_SEL                 ( 765)

/* ER_HOME_MSG[] = "No solution found" */
#define ER_NO_SOLUTION                  ( 780)

/* ER_NON_ALGEBRAIC_VARIABLE_MSG[] = "Non-algebraic variable in expression" */
#define ER_NON_ALGEBRAIC_VARIABLE       ( 790)

/* UNREAL_RESULT_ERR_MSG[] = "Non-real result" */
#define FIRST_UNREAL_ERR                ( 800)
#define UNREAL_RESULT_ERROR             FIRST_UNREAL_ERR + 1
#define EXPECTED_REAL_ERROR             FIRST_UNREAL_ERR + 2

/* MEM_EXHAUST_DML_ERR_MSG[] = "Not enough memory to save current variable.
Please delete unneeded variables on the Var-Link screen and re-open editor as
current OR re-open editor and use F1 8 to clear editor." */
#define ER_MEMORY_DML                   ( 810)

/* OVERFLOW_ERR_MSG[] = "Overflow" */
#define FIRST_OVERFLOW                  ( 830)
#define RATIONAL_NUMERIC_OVERFLOW_ERROR FIRST_OVERFLOW + 1
#define ER_OVERFLOW                     FIRST_OVERFLOW + 2

/* ER_STAT_PLOT_MSG[] = "Plot setup" */
#define ER_STAT_PLOT                    ( 840)

/* ER_PRGM_NOT_FOUND_MSG[] = "Program not found" */
#define ER_PRGM_NOT_FOUND               ( 850)

/* RECURSION_TOO_DEEP_ERR_MSG[] = "Recursion is limited to 255 calls deep"*/
#define RECURSION_TOO_DEEP_ERROR        ( 860)

/* ER_RESERVED_MSG[] = "Reserved name or system variable" */
#define FIRST_RESERVED                  ( 870)
#define ER_RESERVED                     FIRST_RESERVED + 1
#define ER_SYS_FUNC                     FIRST_RESERVED + 2

/* ER_ROM_ROUTINE_NOT_AVAILABLE_MSG[] = "ROM-resident routine not available" */
#define ER_ROM_ROUTINE_NOT_AVAILABLE    ( 875)

/* ER_SEQUENCE_SETUP_MSG[] = "Sequence setup" */
#define ER_SEQUENCE_SETUP               ( 880)

/* ER_SIGNATURE_ERR_MSG[] = "Signature error"  */
#define ER_SIGNATURE_ERR                ( 885)

/* ER_SINGULARMAT_MSG[] = "Singular matrix" */
#define ER_SINGULARMAT                  ( 890)

/* ER_SLOPE_FIELD_FUNCS_MSG[] = "Slope fields need one selected function
and are used for 1st-order equations only"    */
#define ER_SLOPE_FIELD_FUNCS            ( 895)       /* SPAM error */

/* ER_STAT_MSG[] = "Stat" */
#define FIRST_STAT_ERR                  ( 900)
#define ER_WEIGHTS_SUM_NOT_POS          FIRST_STAT_ERR + 1
#define ER_LISTS_CONTAIN_NEG            FIRST_STAT_ERR + 2
#define ER_LISTS_NOT2DISCREET           FIRST_STAT_ERR + 3
#define ER_EMPTY_GROUP_NOT_VALID        FIRST_STAT_ERR + 4

/* ER_SYNTAX_MSG[] = "Syntax" */
#define FIRST_SYNTAX_ERR                ( 910)
#define SYNTAX_ERROR                    FIRST_SYNTAX_ERR + 1
#define UNEXPECTED_CHARACTER_ERROR      FIRST_SYNTAX_ERR + 2
#define EXPECTED_EQUAL_ERROR            FIRST_SYNTAX_ERR + 3
#define EXPECTED_FACTOR_ERROR           FIRST_SYNTAX_ERR + 4

/* ER_TEXT_NOT_FOUND_MSG[] = "Text not found." */
#define ER_TEXT_NOT_FOUND				( 920)

/* TOO_FEW_ARGS_ERR_MSG[] = "Too few arguments" */
#define TOO_FEW_ARGS_ERROR              ( 930)

/* TOO_MANY_ARGS_ERR_MSG[] = "Too many arguments" */
#define TOO_MANY_ARGS_ERROR             ( 940)

/* TOO_MANY_SUBSCRIPTS_ERR_MSG[] = "Too many subscripts" */
#define TOO_MANY_SUBSCRIPTS_ERROR       ( 950)

/* TOO_MANY_UNDEFINED_ERR_MSG[] = "Too many undefined variables" */
#define TOO_MANY_UNDEFINED_ERROR       ( 955)

/* ER_UNDEFINED_VAR_MSG[] = "Undefined variable" */
#define ER_UNDEFINED_VAR                ( 960)

/* ER_UNLICENSED_MSG[] = "Unlicensed OS" */
#define ER_UNLICENSED                   ( 965)

/* ER_IN_USE_MSG[] = "Variable in use so references or changes are not allowed" */
#define FIRST_IN_USE_ERR                ( 970)
#define GRAPH_FUNC_IN_USE_ERROR         FIRST_IN_USE_ERR + 1
#define ER_PROG_OR_FUNC_IN_USE          FIRST_IN_USE_ERR + 2
#define ER_VAR_IN_USE                   FIRST_IN_USE_ERR + 3

/* ER_LOCKED_OR_PROTECTED_MSG[]= "Variable is locked, protected, or archived" */
#define FIRST_LOCKED_OR_PROTECTED       ( 980)
#define ER_LOCKED                       FIRST_LOCKED_OR_PROTECTED + 1
#define ER_PROTECTED                    FIRST_LOCKED_OR_PROTECTED + 2

/* NAME_TOO_LONG_ERR_MSG[] = "Variable name is limited to 8 characters" */
#define NAME_TOO_LONG_ERROR             ( 990)

/* ER_RANGE_MSG[] = "Window variables domain" */
#define ER_RANGE                        (1000)

/* ER_ZOOM_MSG[] = "Zoom" */
#define ER_ZOOM                         (1010)

/* ILLEGAL_TAG_ERR_MSG[] = "Internal error" */
#define FIRST_INTERNAL_ERR              (1020)
#define ILLEGAL_TAG_ERROR               FIRST_INTERNAL_ERR + 1    /* => bug or undetected stack overflow */
#define UNKNOWN_TAG_ERROR               FIRST_INTERNAL_ERR + 2
#define DIVISION_BUG_ERROR              FIRST_INTERNAL_ERR + 3

/* ER_MEM_VIO_MSG[] = "Protected memory violation" */
#define ER_MEM_VIO                      (1030)  /* IF YOU CHANGE THIS VALUE, YOU
MUST ALSO CHANGE IT IN INTS.S */

/*=================================================================================*/
/*                                                                                 */
/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE */
/* ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- */
/*                2048 ->  4093                                                    */
/* ERROR NUMBERS 0X800 -> 0XFFD ARE RESERVED FOR THE A-LINE INTERFACE TO THE JUMP  */
/* TABLE                                                                           */
/*                                                                                 */
/*=================================================================================*/
#ifndef __SIERRA__
/* NGIN in VISUAL C errors */

/*-------------------------------------*/
/* DELIMITER FOR FLOAT AND MATH ERRORS */
#define MIN_FLOAT_OR_MATH_ERROR         (2000)
/* Some FPE codes are for debugging and will probably be removed */
/* In Visual C  FPE_INVALID_ERROR is never masked so always reachable */
#define FPE_INVALID_ERROR   MIN_FLOAT_OR_MATH_ERROR + 1
#define FPE_DENORMAL_ERROR              (2010) /* In Visual C  always masked so unreachable*/
#define FPE_ZERODIVIDE_ERROR            (2020) /* nonzero/0: Will NGIN normaly mask it??*/
#define FPE_OVERFLOW_ERROR              (2030) /* Will NGIN normally mask this ?? */
#define FPE_UNDERFLOW_ERROR             (2040) /* NGIN normally masks this. */
#define FPE_INEXACT_ERROR               (2050) /* NGIN normally masks this. */
#define FPE_UNEMULATED_ERROR            (2060) /* Probably indicates a compiler bug. */
#define FPE_SQRTNEG_ERROR               (2070) /* Does code in my _matherr take precedence??*/
/* Note gap of 2 corresponding to gap in Microsoft _FPE defines: */
/* Surprising since no 2 adj float machine instructions */
#define FPE_MS_GAP_1                    (2080) /*lint !e769 unreferenced */
#define FPE_MS_GAP_2                    (2090) /*lint !e769 unreferenced */
#define FPE_STACKOVERFLOW_ERROR         (2100)
#define FPE_STACKUNDERFLOW_ERROR        (2110) /* Probably indicates compiler bug.*/
/* Standard C math library error codes (may consolodate after debugged): */
#define ACOS_GT_1_ERROR                 (2120)
#define ACOS_LT_MINUS1_ERROR            (2130)
#define ASIN_GT_1_ERROR                 (2140)
#define ASIN_LT_MINUS1_ERROR            (2150)
#define LN_NEG_ERROR                    (2160)
#define LOG10_NEG_ERROR                 (2170)
#define SQRT_NEG_ERROR                  (2180)
#define POW_NEG_TO_FRAC_ERROR           (2190)
#define ATAN2_0_0_ERROR                 (2200)
#define POW_0_TO_NEG_ERROR              (2210)
/* DELIMITER FOR FLOAT OR MATH ERRORS */
#define MAX_FLOAT_OR_MATH_ERROR   POW_0_TO_NEG_ERROR + 1
/*------------------------------------*/
#define CANT_OPEN_ERROR                 (2220) /* No such file, full disk or full dir */
#define IN_BUFFER_OVFL_ERROR            (2230) /* File input expr > IN_STRING_LENGTH */
#define HISTORY_TABLE_OVFL_ERROR        (2240) /* # IO pairs > HISTORY_TABLE_LENGTH */
#define ER_MISSING_RESULT               (2250)
#define KEYBOARD_INTERRUPT_ERROR        (2260) /* Abort computation but not ngin */

#define ER_DISABLED_FEATURE             (2270) /* Featured disabled in this version */
#define ER_EXTENSION_HOOK               (2280) /* Extension puts error message in ExtErrMsg[] */
#define ER_KICKBACK                     (2290) /* Kickback extension input */
/* end of NGIN in VISUAL C only errors */
#endif /* ifndef __SIERRA__ */

#ifdef DEBUG
#define ER_FP_TEST_FAIL                 (4094) /* Used only during FP test and debug */
#endif

#ifndef PET
#define ER_LAST                         (4095) /* DELIMITER FOR END OF ERRORS */
#else
#define ER_NON_NUMERIC_RESULT           (4098)
#define ER_LAST                         (8195)
#endif

/* END OF ERROR CODES ========================================================*/

#endif  /* ifdef _ERROR_H */

/**  end file error.h **/
