PX_WRITE_PRIMARY_INDEX(3)

✨ PX_WRITE_PRIMARY_INDEX ✨

okay bestie, gather round, because this one lives in section 3 of the Library Functions Manual and it's literally the glow-up your Paradox database has been waiting for πŸ’…


🌸 NAME 🌸

PX_write_primary_index β€” write the primary index into a file πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <paradox.h>

int PX_write_primary_index(pxdoc_t *pxdoc, pxdoc_t *pindexdoc)

✨ DESCRIPTION ✨

So here's the tea β˜• β€” this function writes the primary index for the database you passed in as pxdoc.

And listen, because this part matters: that primary index file has to already exist before you call this. You gotta create it first, like any other Paradox file, using PX_create_fp(3) or PX_create_file(3). No index file, no index writing. That's just the rules, iykyk 🌈


πŸ’– RETURN VALUE πŸ’–

  • 0 β€” success!! slay, it worked πŸ‘‘
  • -1 β€” failure, and honestly? we're crying 😭

πŸ’€ BUGS πŸ’€

okay this is the part where I hold your hand. This function will only create primary index files with not more than two levels. Periodt.

ngl that sounds limiting but the manpage is chill about it β€” in general, two levels will be sufficient to handle many thousand records. So for the vast majority of you, this is fine. For the rest of you... it's giving "known limitation," fr fr 🫢


πŸ”₯ SEE ALSO πŸ”₯


🧚 AUTHOR 🧚

This manual page was written by Uwe Steinmann uwe@steinmann.cx. iconic behavior, we love a documented function πŸ’œ


and that's the whole page, bestie!! this lil cutie is PX_write_primary_index(3) from the Library Functions Manual β€” go forth, write those indexes, and remember: create the file FIRST πŸŒΈπŸ’–βœ¨