# Generate reflection code for GML enums Check out this article for why you might want to do this: https://synthasmagoria.github.io/error_handling_in_gm/ The program generates a few functions that make it possible to retreive the names of enums and enum members. To tell the program to generate reflection for a specific enum add `gml_pragma("enum_reflection")` on the line before. ```ts /* This file was generated using enum_reflection tool */ enum Enum { CoolError, _Count } global._ENUM_NAMES = [ "CoolError", ]; global._ENUM_MEMBER_NAMES = [ ["Bad", "Bad2", "Bad3"], ]; function enum_get_name(index) { return global._ENUM_NAMES[index]; } function enum_get_member_name(index, member) { return global._ENUM_MEMBER_NAMES[index][member]; } function enum_get_member_names(index) { return global._ENUM_MEMBER_NAMES[index]; } function enum_get_member_name_full(index, member) { return $"{global._ENUM_NAMES[index]}.{global._ENUM_MEMBER_NAMES[index][member]}"; } ```