HDFql Reference Manual v2.6.0

5.2.3hdfql_error_get_line

Syntax

int hdfql_error_get_line(void)

Description

Get the error line of the last executed operation. In other words, this function returns the number of the line (in the script) where an error was raised during the last call to hdfql_execute. The first line in the script is designated as number one (1).

Parameter(s)

None

Return

int – number of the line (in the script) where an error has occurred during the last executed operation. If the last executed operation was successful, the number of 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 number of the line where an error occurred during the last executed operation (should be "Error line number is -1")
printf("Error line number is %d\n", hdfql_error_get_line());

// 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 number of the line where an error occurred during the last executed operation (should be "Error line number is 1")
printf("Error line number is %d\n", hdfql_error_get_line());