PX_PUT_DATA_BCD(3)
π PX_PUT_DATA_BCD(3) β put value into a bcd data field π
okay so bestie, we're in section 3 of the library functions manual, and this is the glow-up guide for PX_put_data_bcd. it's giving "lowkey niche but highkey important" and i'm obsessed. let's get into it π«Ά
β¨ NAME β¨
PX_put_data_bcd β put value into a bcd data field
like. that's the whole job. put the value. into the bcd data field. iconic behaviour honestly π
πΈ SYNOPSIS πΈ
#include <paradox.h>
void PX_put_data_bcd(pxdoc_t *pxdoc, char *data, int len, char *value)
no cap, that's the whole signature. she takes pxdoc, data, len and value, and she returns absolutely nothing because she's a void girlie and she's at peace with that β¨
π¦ DESCRIPTION π¦
so what does she do? she converts a bcd string into a value for a data field, exactly the way it's stored in the database file. that's the vibe. that's the mission. periodt π
the string may only contain these characters, no others, i'm so serious:
+-0-9.
π¨ bestie listen. ONLY those. anything else and you're on your own. don't test her.
and here's the part that matters: you should use this function instead of accessing the record data directly. i know, i know, poking at the raw record data feels very main character of you, but no. use the function. trust the process. it's giving "i know better than you and also i love you" π
now, data points to the start of the data field in the record. and this is the bit everyone gets wrong, so let's say it slowly π
it must be calculated by summing up all field length before the field to operate on, and adding it to the base pointer of the record.
fr fr. sum up every field length that comes before the field you're operating on, then add that to the base pointer of the record, and that is your data. it's giving math homework but make it database π
π SEE ALSO π
she doesn't run alone, she runs with the whole squad:
PX_put_data_alpha(3)PX_put_data_long(3)PX_put_data_double(3)PX_put_data_short(3)PX_put_data_byte(3)PX_put_data_bytes(3)
collect them all, they're the set π
π AUTHOR π
this manual page was written by Uwe Steinmann uwe@steinmann.cx. thank you for your service king, we appreciate you π«Άβ¨
and that's the whole page bestie, tysm for reading π
πΈ this lil love letter to the PX_put_data_bcd page lives in the Library Functions Manual and its name is, of course, PX_PUT_DATA_BCD(3) β go forth and bcd responsibly π¦ππ
π¦ 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