---
name: "PX_get_data_bcd"
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_get_data_bcd"
---

# PX\_get\_data\_bcd(3)

Get bcd data field

## NAME

PX\_get\_data\_bcd — Get bcd data field

## SYNOPSIS

\#include \<paradox.h\>

int PX\_get\_data\_bcd(pxdoc\_t \*pxdoc, char \*data, int len, char \*\*value)

## DESCRIPTION

Converts a data field as it stored in the database file into  a bcd string. The string will not be longer than 20 chars including  the final 0. It contains only the characters \`+', \`-', \`0-9', and \`.'.  You should use this function  instead of accessing the data directly.

**data** points to the start of the data field in the  record. It must be calculated by summing up all field length before  the field to operate on and add it to the base pointer of the  record. **len** is the number of digits after the decimal  point.

The function allocates memory for the string returned in  **\*value**. This memory has to be freed by the application.

**Note:**

**This function is deprecated and obsolete if**  **[PX\_retrieve\_record(3)](/PX_retrieve_record/3.md) is used.**

## RETURN VALUE

**Returns 0 if the value is NULL, -1 in case of an error and 1**  **otherwise.**

## SEE ALSO

**[PX\_get\_data\_alpha(3)](/PX_get_data_alpha/3.md), [PX\_get\_data\_byte(3)](/PX_get_data_byte/3.md), [PX\_get\_data\_long(3)](/PX_get_data_long/3.md), [PX\_get\_data\_short(3)](/PX_get_data_short/3.md), [PX\_get\_data\_double(3)](/PX_get_data_double/3.md)**

## AUTHOR

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