nag_error_name_to_code (x04ncc) (PDF version)
x04 Chapter Contents
x04 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_error_name_to_code (x04ncc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_error_name_to_code (x04ncc) takes, as a string argument, the name of a NAG error (e.g., NE_BAD_PARAM) and returns, as an int, the corresponding fail code for the given NAG error.

2  Specification

#include <nag.h>
#include <nagx04.h>
int  nag_error_name_to_code (const char *error_name)

3  Description

nag_error_name_to_code (x04ncc) takes, as a string argument, the name of a NAG error (e.g., NE_BAD_PARAM) and returns, as an int, the corresponding fail code for the given NAG error. If the input string does not correspond to a NAG error name then the function returns -1.
Converting the error name to int may be useful when the NAG Header Files are not available, but the int value of an error name is required, say, for checking fail.code following a call to a NAG function.

4  References

None.

5  Arguments

1:     error_nameconst char *Input
On entry: the value of a NAG enumeration member.

6  Error Indicators and Warnings

If the value -1 is returned then the input value is not recognized as a valid NAG fail code.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

This example produces integer error codes corresponding to a number of error code names.

10.1  Program Text

Program Text (x04ncce.c)

10.2  Program Data

None.

10.3  Program Results

Program Results (x04ncce.r)


nag_error_name_to_code (x04ncc) (PDF version)
x04 Chapter Contents
x04 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2014