Routines (alphabetical) > Routines: H > HDF Routines > HDF_VD_READ

# HDF_VD_READ

The HDF_VD_READ function reads data from a VData in an HDF file.

The default is to use FULL_INTERLACE and to read all fields in all records. The user can override the defaults with keywords. If multiple fields with different data types are read, all of the data is read into a byte array. The data must then be explicitly converted back into the correct type(s) using various IDL type conversion routines. For example:

nread = HDF_VD_READ(vdat, x, NREC=1, FIELDS=”FLT,LNG”)

floatvalue = FLOAT(x, 0)

longvalue = LONG(x, 4)

## Examples

Typical read:

NREC = HDF_VD_READ(Vdat, X)

Read one field:

NREC = HDF_VD_READ(Vdat, X, FIELDS='VEL')

Read a record:

NREC = HDF_VD_READ(Vdat, X, NRECORDS=1)

## Syntax

Result = HDF_VD_READ( VData, Data [, FIELDS=string] [, /FULL_INTERLACE | , /NO_INTERLACE] [, NRECORDS=records] )

## Return Value

This function returns the number of records successfully read from the VData.

## Arguments

### VData

The VData handle returned by a previous call to HDF_VD_ATTACH.

### Data

A named variable in which the data is returned.

## Keywords

### FIELDS

A string containing a comma-separated list of fields to be read. Normally HDF_VD_READ will read all fields in the VData.

### FULL_INTERLACE

Set this keyword to use full interlace when reading (the default).

### NO_INTERLACE

Set this keyword to use no interlace when reading.

### NRECORDS

The number of records to read. By default, HDF_VD_READ reads all records from a VData.

## Version History

4.0 | Introduced