5.2.4hdfql_error_get_position
Syntax
int hdfql_error_get_position(void)
Description
Get the error position of the last executed operation. In other words, this function returns the position in the line where an error was raised during the last call to hdfql_execute. The first position in the line is designated as number one (1).
Parameter(s)
None
Return
int – position in the line where an error has occurred during the last executed operation. If the last executed operation was successful, the position in the line will be HDFQL_UNDEFINED.
Example(s)
// execute script (composed of only one operation (i.e. CREATE FILE my_file.h5), which is syntactically correct)
hdfql_execute("CREATE FILE my_file.h5");
// display position in the line where an error occurred during the last executed operation (should be "Error position is -1")
printf("Error position is %d\n", hdfql_error_get_position());
// execute script (composed of only one operation (i.e. CREATE FILEX my_file.h5), which is syntactically incorrect due to a typo in "FILEX")
hdfql_execute("CREATE FILEX my_file.h5");
// display position in the line where an error occurred during the last executed operation (should be "Error position is 8")
printf("Error position is %d\n", hdfql_error_get_position());