PX_RETRIEVE_RECORD(3)
π PX_RETRIEVE_RECORD π
okay bestie, welcome to the PX_retrieve_record(3) page from the Library Functions Manual β yes it's a library function, yes it's giving β¨database girlieβ¨, let's get into it π«Ά
πΈ NAME πΈ
PX_retrieve_record β literally hands you a record out of a Paradox file. that's the whole job. no cap. π
π¦ SYNOPSIS π¦
#include <paradox.h>
pxval_t ** PX_retrieve_record(pxdoc_t *pxdoc, int recno)
β¨ DESCRIPTION β¨
So here's the tea: this function returns the record with the given number inside a Paradox file. The first record has number 0, and the last one has number number_of_records-1. Zero-indexed, obviously, we love that for us. π
And listen β if you're grabbing a bunch of records, pls do it in ascending order. It's genuinely the most efficient way and the vibes will be immaculate. π₯
The return value is an array of field values, and every single value is tucked inside a structure that looks exactly like this:
typedef struct px_val pxval_t;
struct px_val {
char isnull;
int type;
union {
long lval;
double dval;
struct {
char *val;
int len;
} str;
} value;
};
okay let's break down the members because this is the part where people get lost and we are NOT letting that happen to you π
- The element
isnullis set to1if the value is NULL, otherwise it gets set to0. That's it, that's the flag. typeis the type of the paradox field as defined inparadox.h.- A field value can be either a long int, a double, or a string, depending on the paradox field type.
Now for the mapping, and this matters so stay with me:
- The paradox field types
pxfShort,pxfLong,pxfDate,pxfTime,pxfLogical, andpxfAutoIncare returned as long int values. pxfTimestamp,pxfNumber, andpxfCurrencyare returned as double values.- All the remaining paradox field types are stored as strings, with the length sitting in
value.len. And yes, you can rely on strings being Null terminated. π
β οΈ except bestie, careful: Blobs are stored as string but are not guarented to be Null terminated. so do not go assuming, okay? π
One more thing β the paradox field types pxfTimestamp, pxfTime, and pxfDate use an uncommon format. If you want them as a string, you convert them with PX_timestamp2string(3), PX_time2string(3), and PX_date2string(3). they've got your back π
π RETURN VALUE π
Returns a pointer on success and NULL on failure. simple as that. slay. β
π SEE ALSO π
π AUTHOR π
This manual page was written by Uwe Steinmann uwe@steinmann.cx. iconic behaviour, we stan a documentation author π
and that's the whole page, bestie!! this was PX_RETRIEVE_RECORD(3) from the Library Functions Manual, footer title and all β no date, no version, just the name holding it down at the bottom. go retrieve those records, you're gonna ate π¦π
β¨
π¦ where this page comes from
- debian bookworm: pxlib-dev 0.6.8-1+b1
- debian trixie: pxlib-dev 0.6.9-1+b1
- ubuntu jammy: pxlib-dev 0.6.8-1
- ubuntu noble: pxlib-dev 0.6.8-1
- ubuntu questing: pxlib-dev 0.6.9-1
- ubuntu resolute: pxlib-dev 0.6.9-1build1
- ubuntu stonking: pxlib-dev 0.6.10-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms