HDFql Reference Manual v2.6.0

5.2.7hdfql_cursor_use

Syntax

int hdfql_cursor_use(const HDFQL_CURSOR *cursor)

Description

Set the cursor named cursor as the one to be used for storing the results of operations.

Parameter(s)

cursor – pointer to a cursor to use for storing the results of operations. If the pointer is NULL (in C), the HDFql default cursor is used instead (i.e. equivalent to calling the function hdfql_cursor_use_default). The equivalent of a NULL pointer in C++, Java, Python, C#, Fortran, R, and MATLAB HDFql wrappers is NULL, null, None, null, NULL(), NULL, and NaN, respectively.

Return

int – depending on the success in using cursor, it can either be HDFQL_SUCCESS or HDFQL_ERROR_NOT_REGISTERED.

Example(s)

// create a cursor named "my_cursor" 
HDFQL_CURSOR my_cursor; 

// use cursor "my_cursor" 
hdfql_cursor_use(&my_cursor); 

// initialize cursor "my_cursor" 
hdfql_cursor_initialize(NULL);

// display data type of cursor "my_cursor" (should be "Data type of cursor -1") 
printf("Data type of cursor is %d\n", hdfql_cursor_get_data_type(NULL));

// show (i.e. get) working directory currently in use 
hdfql_execute("SHOW USE DIRECTORY");

// display (again) data type of cursor "my_cursor" (should be "Data type of cursor is 2097152")
printf("Data type of cursor is %d\n", hdfql_cursor_get_data_type(NULL));

// use HDFql default cursor 
hdfql_cursor_use(NULL);

// display data type of HDFql default cursor (should be "Data type of cursor is -1") 
printf("Data type of cursor is %d\n", hdfql_cursor_get_data_type(NULL));