gtpc2mhiC/C++ Language Support User's Guide

TO2_getNumberOfRecords-Return the Number of Records Used

This function returns the number of records used.

Format

#include <c$to2.h>
long  TO2_getNumberOfRecords (const TO2_PID_PTR  pid_ptr,
                                    TO2_ENV_PTR  env_ptr);

pid_ptr
The pointer to the persistent identifier (PID) assigned to the collection that will be interrogated.

env_ptr
The pointer to the environment as returned by the TO2_createEnv function.

Normal Return

The number of records used by TPF collection support (TPFCS) to hold and organize the data of the collection will be returned.

Error Return

Not applicable.

Programming Considerations

This function does not use TPF transaction services on behalf of the caller.

Examples

The following example prints the number of assigned records.

#include <c$to2.h>          /* Needed for TO2 API functions     */
#include <stdio.h>          /* APIs for standard I/O functions  */
TO2_ENV_PTR    env_ptr;     /* PTR to the TO2 environment       */
TO2_PID        collect;     /* PTR to PID return field          */
long           numberofrecords;

  ·
  ·
  ·
numberofrecords = TO2_getNumberOfRecords(&collect, env_ptr); printf("The number of records is %ld.\n", numberofrecords);

Related Information

None.