int varfind(data,name)
SURVO_DATA *data; /* pointer to data structure */
char *name; /* name of variable */
int varfind2(data,name,error_display)
SURVO_DATA *data; /* pointer to data structure */
char *name; /* name of variable */
int error_display;/* 1=on 0=off */
The varfind function finds the index corresponding to the given name
of a variable (field) in data
opened by data_open or data_open2.
Comparisons between names are performed by using the first 8 characters
only. Trailing blanks are not counted. varfind is case-sensitive. Thus
"Weight" is different from "weight".
varfind returns # of variable or -1 if no variable corresponding to name
is found. In the latter case an error message is displayed.
varfind2 works as varfind, but in case of an error (variable not found)
no error message is displayed if error_display=0
.
int i;
SURVO_DATA dat;
i=data_open("TEST",&dat);
if (i<0) return;
i=varfind(&dat,"Weight");