The HDF_VG_ATTRGET function retrieves the data within a VGroup's attribute.

Example


file = FILEPATH('vattr_example.hdf', SUBDIR=['examples', 'data'])
FileHandle = HDF_OPEN(file, /READ)
vgID = HDF_VG_GETID(FileHandle, -1)
VGroup = HDF_VG_ATTACH(FileHandle, vgID, /READ)
HDF_VG_GETINFO, VGroup, NAME=name, NATTRIBUTES=nattr
PRINT, name + '  number of attributes = ', nattr
 
; Find the attribute with the given name.
index = HDF_VG_ATTRFIND(VGroup, "MyAttributeSTRING")
 
; Determine the attribute info and value
HDF_VG_ATTRINFO, VGroup, index, COUNT=c, HDF_TYPE=hdfType, $
  NAME=attrname, SIZE=siz, TYPE=idlType
value = HDF_VG_ATTRGET(VGroup, index)
 
PRINT, attrname, ':  COUNT=', c.ToString(), $
  ' SIZE=', siz.ToString(), '  HDFtype=', hdfType, $
  '  IDLtype=', idlType, '  Value=', value
HDF_CLOSE,FileHandle

IDL prints:

RIG0.0  number of attributes =            8
MyAttributeSTRING:  COUNT=3 SIZE=3  HDFtype=DFNT_CHAR8  IDLtype=STRING  Value=ABC

Syntax


Result = HDF_VG_ATTRGET(VGroup, Index)

Return Value


Returns the specified attribute’s value.

Arguments


VGroup

The VGroup handle returned by a previous call to HDF_VG_ATTACH.

Index

The index of the attribute to retrieve. Index should be an integer in the range 0 to the number of attibutes minus 1. You can use HDF_VG_GETINFO to retrieve the number of attributes in the VGroup.

Keywords


None

Version History


8.5.1

Introduced

See Also


HDF_VG_ATTRFIND, HDF_VG_ATTRINFO,  HDF_VG_ATTRSET,  HDF_VG_GETINFO