HDF_SD_NAMETOINDEX

The HDF_SD_NAMETOINDEX function returns an SD dataset index given its name and SD interface ID. An error message is printed if the dataset cannot be located. The returned index can be used by HDF_SD_SELECT to access an SD dataset.

Calling Sequence

Result = HDF_SD_NAMETOINDEX( SD_ID, SDS_Name )

Arguments

SD_ID

An SD interface ID as returned by HDF_SD_START.

SDS_Name

A string containing the name of the SD dataset be located.

Example

sd_id = HDF_SD_START('demo.hdf') ; Start the SD interface.

index = HDF_SD_NAMETOINDEX(sd_id, 'variable_2')
; Return the index of the `variable_2' dataset.

sds_id=HDF_SD_SELECT(sd_id,index) ; Access the dataset.

HDF_SD_ENDACCESS, sds_id ; End access.

HDF_SD_END, sd_id

See Also

HDF_SD_REFTOINDEX , HDF_SD_SELECT , HDF_SD_START