5.2.55hdfql_variable_get_number
Syntax
int hdfql_variable_get_number(const void *variable)
Description
Get the number of a variable named variable. This refers to the number that was calculated by HDFql and assigned to the variable upon registering it with the function hdfql_variable_register. If variable has never been registered or has been unregistered, an error is returned.
Parameter(s)
variable – pointer to a variable to get the number (calculated by HDFql) assigned to it.
Return
int – depending on the success in getting the number assigned to the variable, it can be equal to or greater than zero (i.e. the number assigned to the variable), HDFQL_ERROR_NO_ADDRESS, or HDFQL_ERROR_NOT_REGISTERED.
Example(s)
// declare variables
short data0[3];
float data1[5];
// register variable "data0" for subsequent use (by HDFql)
hdfql_variable_register(data0);
// register variable "data1" for subsequent use (by HDFql)
hdfql_variable_register(data1);
// display number of variable "data0" (should be "Number of variable is 0")
printf("Number of variable is %d\n", hdfql_variable_get_number(data0));
// display number of variable "data1" (should be "Number of variable is 1")
printf("Number of variable is %d\n", hdfql_variable_get_number(data1));