Seppo Mustonen : Programming Survo in C

Functions in library SURVO.LIB

data_alpha_load
Summary

int data_alpha_load(data,j,i,string)
SURVO_DATA *data; /* pointer to data structure */
long j;           /* # of observation (record) */
int i;            /* # of variable (field) */
char *string;     /* pointer to data value */
Description

The data_alpha_load function reads the value of the jth observation in variable # i (i=0,1,...,data->m-1) as a null-terminated string from data opened by data_open or data_open2. Only variables of string (S) type can be loaded by data_alpha_load.

Return Value

data_alpha_load returns 1 if the value is found. Otherwise -1 is returned.

See Also

data_load

Example

int i;
long j;
char value[LLENGTH];
SURVO_DATA dat;

i=data_open("TEST",&dat);
if (i<0) return;
sprintf(sbuf,"\nValues of variable %s:",dat.varname[3]);
sur_print(sbuf);
for (j=dat.l1; j<=dat.l2; ++j)
  {
  data_alpha_load(&dat,j,3,value);
  sprintf(sbuf, "\nValue of var. # %d in obs. # %ld is %s", i+1,j,value);
  sur_print(sbuf);
  }
/* open TEST and print values of var. #4 as strings */


Front page of Survo C libraries