# PxIOAddIndex

> Source: https://manual.pvxplus.com/pxio-library/library-functions/miscellaneous-file-functions/pxioaddindex

## Description

Add a key to a keyed file without having to rebuild the file

## Format

**int** **PxIOAddIndex(PxIOFileHandle handle, struct KEYDEF \*pKeyDef);**

***Where:***

|  |  |
| --- | --- |
| **handle** | The handle of an open keyed file |
| **pKeyDef** | The key definition of the key to add. For details on the format of a key definition, see **[Appendix H](https://manual.pvxplus.com/pxio-library/library-functions/appendix-references/appendix-h)** for the KEYDEF structure in PxIO.h. |

## Return Value

If the function succeeds, a value of PXIO_SUCCESS_STATUS is returned; otherwise, an error value is returned. More information on the nature of the error can be found by calling **[PxIOGetError](https://manual.pvxplus.com/pxio-library/library-functions/error-functions/pxiogeterror)**.
