Put your record definition in the header file (.hrl). For example, animal.hrl might look like this:
-record(animal, {name, legs=4, eyes=2}).
Then you can include the .hrl file in your .erl files as follows:
-include_lib("animal.hrl").
- I would recommend reading this one .
- Please note that the .hrl file should probably be placed in your
src directory if it is not needed outside your application - in this case you should place it in a directory called include .
source share