---
name: "PX_write_primary_index"
section: "3"
platform: "linux"
package: "pxlib-dev"
version: "0.6.9-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PX_write_primary_index"
---

# PX\_write\_primary\_index(3)

Write primary index into a file

## NAME

PX\_write\_primary\_index — Write primary index into a file

## SYNOPSIS

\#include \<paradox.h\>

int PX\_write\_primary\_index(pxdoc\_t \*pxdoc, pxdoc\_t \*pindexdoc)

## DESCRIPTION

Writes the primary index for the database passed in  **pxdoc**. The primary index file  must be created before as any Paradox file with [PX\_create\_fp(3)](/PX_create_fp/3.md) or  [PX\_create\_file(3)](/PX_create_file/3.md).

## RETURN VALUE

Returns 0 on success and -1 on failure.

## BUGS

This function will only create primary index files with not  more than two levels. In general this will be sufficient to  handle many thousand records.

## SEE ALSO

[PX\_create\_fp(3)](/PX_create_fp/3.md), [PX\_create\_file(3)](/PX_create_file/3.md), PX\_read\_primary\_file(3)

## AUTHOR

This manual page was written by Uwe Steinmann uwe@steinmann.cx.
