---
name: "get_datafile_property"
section: "3alleg4"
platform: "linux"
package: "allegro4-doc"
version: "2:4.4.3.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/get_datafile_property/3alleg4"
---

# get\_datafile\_property(3alleg4)

Returns the property string for the object. Allegro game programming library.

## NAME

get\_datafile\_property - Returns the property string for the object. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**const char \*get\_datafile\_property(const DATAFILE \*dat, int type);**

## DESCRIPTION

Finds the property type of a DATAFILE object. The type parameter must be a value created with the DAT\_ID() macro. Example:

```
   const char *name;
   ...
   name = get_datafile_property(game_data,
                                DAT_ID('N','A','M','E'));
   if (name == empty_string)
      abort_on_error("Object doesn't have a name!");
```

## RETURN VALUE

Returns a pointer to the text string for the object, or a pointer to the variable empty\_string if the property isn't present.

## SEE ALSO

**DAT\_ID**(3alleg4), **empty\_string**(3alleg4)
