L_VecGetGroupCount

#include "lvkrn.h"

L_INT EXT_FUNCTION L_VecGetGroupCount(pVector)

const pVECTORHANDLE pVector;

/* pointer to a vector handle */

Returns the number of groups inside a vector handle.

Parameter

Description

pVector

Pointer to the vector handle.

Returns

Number of groups.

Comments

After calling this function, L_VecGetGroupByIndex can be used to iterate through the groups in a vector handle.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

L_VecGetGroupByName, L_VecGetGroupByIndex, L_VecGetGroup

Topics:

Working with Vector Groups

Example

/* This example will show the names of the all groups inside a vector handle, in a message box */
L_VOID ShowGroups( pVECTORHANDLE pVector )
{
   L_INT             nCount, i;
   VECTORGROUP       Group;
   VECTORGROUPDESC   GroupDesc;

   /* Get number of groups inside the vector handle */
   nCount = L_VecGetGroupCount( pVector );

   /* Iterate through the groups */
   for( i = 0; i < nCount; i++ )
   {
      /* Get group and its descriptor */
      L_VecGetGroupByIndex( pVector, i, &Group );
      L_VecGetGroup( pVector, &Group, &GroupDesc );

      /* Show name in a message box */
      MessageBox( NULL, GroupDesc.szName, TEXT("Group Name"), MB_OK );

      /* Free the group descriptor because it's no longer needed */
      L_VecFreeGroup( &GroupDesc );
   }
}