---
name: "get_datafile_property"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/get_datafile_property"
---

# get\_datafile\_property(3alleg)

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**(3alleg)](/DAT_ID/3alleg.md), [**empty\_string**(3alleg)](/empty_string/3alleg.md)
