Purpose
|
Establishes the fields to be accessed within the vdata by any subsequent read or write routine (VSread or VSwrite).
|
Return value
|
Returns SUCCEED (or 0) if successful and FAIL (or -1) otherwise.
|
Description
|
Fields are specified by the string argument fields, a comma-separated list of fieldnames (e.g. "PX,PY,PZ"). The combined width of the fields in a vdata must be less than MAX_FIELD_SIZE bytes. If an attempt to create a larger record is made, VSsetfields will return an FAIL.
|
|
The fieldnames allowed depends on the access of the vdata: If access is "r", the fieldnames must be one of the names of the fields that existed in the vdata when that vdata was created. If access is "w", the fieldnames can be any fieldname that has been defined by calling VSfdefine. Users may define any fields to be used in a vdata. Several fieldnames have already been predefined, and may be used without having to define them. See the HDF User's Guide for details.
|
|
VSsetfields must be called before any called to VSread or VSwrite is allowed. It sets up the data translation tables for accessing the data in a vdata.
|
|
For reading from a vdata, a call to VSsetfields sets up the fields that are to be retrieved from records in the vdata. If an empty vdata is attached for a read, VSsetfields will return FAIL.
|
|
For writing to a vdata, VSsetfields can only be called once, to set up the fields (i.e. format) of the records in a vdata. Once the vdata format is set, it may not be changed.
|