GetFmtErrNdx
int GetFmtErrNdx (void);
Purpose
If the format string of the preceding call contains an error, such as an invalid format or an inappropriate modifier, the return value of GetFmtErrNdx indicates the position within the format string, beginning with position zero, where the error was found. This information is useful in debugging faulty format strings. GetFmtErrNdx can report only one error per call, even if several errors exist within the string.
Example Code
int i, n;
Scan ("1234", "%s>%d", &i);
n = GetFmtErrNdx ();
/* n will have the value -1, indicating that */
/* no error exists in the format string. */
Parameters
None.
Return Value
Name | Type | Description |
formatStringIndex | int | Zero–based index into the format string that indicates where GetFmtErrNdx found the non–recognizable format specifier. GetFmtErrNdx returns –1 when no error has occurred. |
Additional Information
Library: Formatting and I/O Library
Include file: formatio.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later