@defined()

Tests to see if a dictionary item or an attribute is defined.

Syntax

@defined (dictionary item|attribute_name)

Type

HyperMesh Template Function

Inputs

dictionary item
The name of a dictionary item. This function returns 1 if the dictionary item is active or 0 if the dictionary item is not active. If the dictionary item does not exist, the function returns 0.
attribute_name
The name of the attribute.

Example

This function allows dictionary items to be set as a toggle that you can turn off and on. During translation, @defined() can be used to see if the item has been toggled on or off.

If the attribute with the given name is defined on this entity, the function returns 1; otherwise, it returns 0. If it cannot find the attribute on the current entity, @defined will also check the dictionaries.hm_defined does not check the dictionaries because the dictionaries cannot be accessed outside the template.