HDF_DFAN_GETDESC

The HDF_DFAN_GETDESC procedure reads the description for the given tag and reference number in a Hierarchical Data Format file.

Calling Sequence

HDF_DFAN_GETDESC, Filename, Tag, Ref, Description

Arguments

Filename

A scalar string containing the name of the file to be read.

Tag

The tag number.

Ref

The reference number.

Description

A named variable in which the description is returned as a vector of bytes.

If a description does not exist, the Description variable will contain either a 0L (long-integer zero) or a blank string, and a warning message will be printed. Warning messages can be suppressed by setting the !QUIET system variable to a non-zero value.

Keywords

STRING

Set this keyword to return the description as a string rather than a vector of bytes.

Example

desc1 = 'FILE DESCRIPTION NUMBER 1'

tag_image = 302

file = 'DEMOdesc.hdf'

fid = HDF_OPEN(file, /CREATE)

HDF_DFR8_ADDIMAGE, file, DIST(10)

HDF_DFAN_PUTDESC, file, tag_image, HDF_DFR8_LASTREF(), desc1

Read the description and return a vector of bytes:

HDF_DFAN_GETDESC, file, tag_image, HDF_DFR8_LASTREF(), out_desc1

HELP, out_desc1

IDL prints:

OUT_DESC1 BYTE = Array(25)

PRINT, STRING(out_desc1)

IDL prints:

FILE DESCRIPTION NUMBER 1

Read the description and return an IDL string variable:

HDF_DFAN_GETDESC, file, tag_image, HDF_DFR8_LASTREF(), $

    out_desc2, /STRING

HELP, out_desc2

IDL prints:

OUT_DESC2 STRING = 'FILE DESCRIPTION NUMBER 1'

HDF_CLOSE, fid

See Also

HDF_DFAN_PUTDESC