PX_GET_DATA_SHORT(3)

πŸ’– PX_GET_DATA_SHORT(3) πŸ’–

okay bestie, so this one lives in the Library Functions Manual section, and it's literally called PX_get_data_short. Yes it's a 3, yes that means C library, yes we're doing this. Let's get into it 🫢


✨ NAME ✨

PX_get_data_short β€” grab a value out of a short data field, no cap πŸ’…


🌸 SYNOPSIS 🌸

#include <paradox.h>

int PX_get_data_short(pxdoc_t *pxdoc, char *data, int len, short int *value)

πŸ¦‹ DESCRIPTION πŸ¦‹

So what this does is it takes a data field exactly how it's stored in the database file and converts it into a short integer for whatever architecture your host is running. Which is the whole point β€” please use this function instead of poking at the data directly, okay? Direct access is not the vibe, this is the vibe. ✨

data points to the start of the data field inside the record. And how do you figure out where that is? You gotta add up all the field lengths of every field that comes before the field you're trying to operate on, and then add that sum to the base pointer of the record. It's giving arithmetic homework but make it ✨data structures✨.

⚠️ Note, and this one matters: This function is deprecated and obsolete if you're using PX_retrieve_record(3). Like, if you're already calling that, you do not need this. Periodt. πŸ™ˆ

πŸ‘‘ RETURN VALUE πŸ‘‘

  • 0 β€” the value is NULL, nothing to see here πŸ’€
  • -1 β€” bestie, there was an error 😭
  • 1 β€” otherwise! we ate πŸ”₯

🌈 SEE ALSO 🌈

the whole little squad, obsessed πŸ’œ


πŸŽ€ AUTHOR πŸŽ€

This manual page was written by Uwe Steinmann uwe@steinmann.cx. slay, thank you for your service 🫑✨


okay that's the whole thing!! this page is from the Library Functions Manual, and yeah, the footer just says PX_GET_DATA_SHORT(3) right back at you β€” the classic little mirror moment at the bottom of every manpage πŸ’– πŸ¦‹ bye bestie, go convert some short data fields πŸ’