[Top] [Prev] [Next] [Bottom]

Vgetid/vfgid

int32 Vgetid(int32 file_id, int32 vgroup_ref)
file_id

IN:

File identifier returned by Hopen

vgroup_ref

IN:

Reference number of the previous vgroup

Purpose

Searches through the HDF file and returns the reference number of the next vgroup following the vgroup that has the reference number vgroup_ref. It is used to sequentially search the file for vgroups.

Return value

Returns the reference number of the next vdata if successful and FAIL (or -1) otherwise.

Description

To initiate a search, call this routine with a vgroup_ref value of -1. This will return the reference number of the first vgroup in the file. Searching past the last vgroup in the file will return an error.

Example

This sample code prints out the reference numbers of all vgroups in the HDF file.


     int32 file_id; /* id of an opened HDF file */
     int32 vgroup_ref;

     file_id = Hopen("myfile.hdf",DFACC_READ,0);
     Vstart(file_id);
     vgroup_ref = -1;
     while (1) {
       vgroup_ref = Vgetid(file_id, vgroup_ref);
       if (vgroup_ref == -1) break;
       printf("found vgroup with id %d\n", vgroup_ref);
     }

     Vend(file_id);
     Hclose(file_id); 
FORTRAN

integer function vfgid(file_id, vgroup_ref)

integer file_id, vgroup_ref



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Reference Manual, Draft 06/09/97, NCSA HDF Development Group.