NAME

var_read -- [ALPHA]

PROTOTYPE

unitptr var_read( char *pcName, int iNum, int iFields, char **ppcFmt, char *pcFile, unitptr uHost)

ARGUMENTS

char *pcName
name of variable record array
int iNum
nr of dimensions
int iFields
nr of fields per record
char **ppcFmt
format of single record
char *pcFile
initializer for file name
unitptr uHost
host unit

RETURN VALUE:

A pointer to the created unit or NULL in the case of an error.

INTERFACE OF CREATED UNIT:

EXECUTION OF CREATED UNIT:

INITIALIZATION:

DESCRIPTION:

The var_read unit has a single input field of type string. When the var_read unit is executed and the input string is the same as at the previous execution step, the unit does nothing. Otherwise, it looks for a file with the given name, and reads maximally iNum records, replacing the current contents of the associated var_def unit. The records are taken to be the elements of the index hypercube that was defined for the associated var_def unit. Reading terminates when for each index value an element was read, or when the end-of-file was reached, whichever occurred earlier. Initial comment lines and lines not matching the specified format are discarded. Initial records can be skipped, either by preceding fscanfs into the same file, or by providing a nr of lines to skip, or both. The for_var unit has as its output fields the fields of the associated var_def unit. When it is executed, it iterates its operands over the data set in the var_def unit. An additional output index vector indicates the current data record at the output. If the var_def unit was filled by a previous var_read invocation, the iteration will be restricted to the set of newly loaded variables.

EXAMPLES:

STATUS:

Preliminary.

SEE ALSO:

FILE

/amnt/loge/users/nistaff02/nistaff/rhaschke/nst7/man/../o.linux//../nstsrc/nst_var.c