Defining aliases

An alias is simply an alternate name for a structure. A single structure can have more than one alias. The alias can be used instead of the structure name when including a structure in a source file or when referencing a structure for a field that is a struct data type. All structure names, whether real or alias, must be unique. (Consequently, when you copy a structure, its aliases are not copied.)

For example, aliases are useful when you are converting an application that uses short, cryptic identifier names to use the Repository. To use longer, more meaningful names in the repository, you can create aliases to simplify updating your Synergy code. Aliases can also be useful when you want to define structfields, but still need that repository structure to be included as a record in your Synergy code. You can create an alias and reference that in your structfield definition.

When you include a structure from the repository in your Synergy code, the compiler first searches for a structure that has the name specified in the .INCLUDE statement. If it can’t find one, it searches for an alias with the same name.

To display the Alias Definitions list:

1. Highlight the structure in the Structure Definitions list.
2. Select Structure Functions > Edit Attributes.
3. Select Attributes > Aliases to display the Alias Definitions list.

Defining a new alias

1. From the Alias Definitions list, select Alias Functions > Add Alias.
2. Enter a name for the alias. The name must be unique among all structure and alias names in the repository. The alias name can have a maximum of 30 characters and must begin with a letter. The remaining characters can be letters, digits, underscores (_), or dollar signs ($).
3. Exit the Alias Definition window to save the alias and return to the Alias Definitions list. Aliases are added alphabetically to the list.

You can also define an alias for a field, but you must use the ALIAS statement in the Synergy Data Language to do so.

Deleting an alias

You cannot delete an alias if it is referenced by a structfield.

1. Highlight the alias in the Alias Definitions list.
2. Select Alias Functions > Delete Alias.
3. At the prompt, select Yes to delete the alias or No to cancel the deletion.