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

# HDF_DFAN_LABLIST

The HDF_DFAN_LABLIST function retrieves a list of the reference numbers and the corresponding labels for a given tag in an HDF file.

## Examples

tag_image = 302

file = 'DEMOlablist.hdf'

n_images = HDF_DFAN_LABLIST(file, tag_image, refs, list, /STRING)

help, n_images, refs, list

PRINT, list(0)

; Find all the compressed images:

tag_image_comp = 303

n_comp_images = HDF_DFAN_LABLIST(file, tag_image_comp, $

refs, list, MAXLABEL=5)

HELP, n_comp_images, refs, list

#### IDL Output

N_IMAGES LONG = 2

REFS INT = Array(2)

LIST STRING = Array(2)

SAMPLE IMAGE LABEL

N_COMP_IMAGES LONG = 3

REFS INT = Array(3)

LIST BYTE = Array(5, 3)

## Syntax

Result = HDF_DFAN_LABLIST( Filename, Tag, Reflist, Labellist [, LISTSIZE=value] [, MAXLABEL=value] [, STARTPOS=value] [, /STRING] )

## Return Value

If successful, the number of entries found is returned.

## Arguments

### Filename

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

### Tag

The tag number.

### Reflist

A named variable in which an array of reference numbers associated with the given tag is returned.

### Labellist

A named variable in which an array of labels is returned. Unless the STRING keyword is set, Labellist will contain an N_ELEMENTS(Reflist) by MAXLABEL array of bytes. Note that array elements containing labels that are shorter than MAXLABEL will be padded with zeroes.

## Keywords

### LISTSIZE

Set the maximum size of the Reflist and Labellist returned. The default is to read all references present, or 20 if the inquiry to obtain the number of references fails.

### MAXLABEL

Use this keyword to override the default label length of 16.

### STARTPOS

Use this keyword to set the default starting position in the Reflist array.

### STRING

Set this keyword to return an array of strings rather than an array of bytes. If STRING is set, the MAXLABEL keyword is ignored and full-length strings are returned.

## Version History

4.0 | Introduced

## See Also

HDF_DFAN_GETLABEL, HDF_DFAN_PUTLABEL