Unique Ids: Difference between revisions

From HLKitWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Basic Concepts and Terminology]]
[[Category:Basic Concepts and Terminology]]
[Context: [[Home|HL Kit]] … [[Basic Concepts and Terminology]]]
[Context: [[Home|HL Kit]] … [[Basic Concepts and Terminology]]]
{{context:|xyz}}
{{context|xyz}}


Most objects within HL are assigned a unique identifier so that they can be easily referenced throughout the data files. For example, each thing needs to have a unique value. HL uses unique ids for naming objects. Unique ids must comply with a number of rules, as outlined below. These rules enable HL to achieve significant performance optimizations at run-time, so these restrictions are important.
Most objects within HL are assigned a unique identifier so that they can be easily referenced throughout the data files. For example, each thing needs to have a unique value. HL uses unique ids for naming objects. Unique ids must comply with a number of rules, as outlined below. These rules enable HL to achieve significant performance optimizations at run-time, so these restrictions are important.

Revision as of 06:41, 22 November 2008

[Context: HL Kit … Basic Concepts and Terminology] Context: HL Kit … xyz 

Most objects within HL are assigned a unique identifier so that they can be easily referenced throughout the data files. For example, each thing needs to have a unique value. HL uses unique ids for naming objects. Unique ids must comply with a number of rules, as outlined below. These rules enable HL to achieve significant performance optimizations at run-time, so these restrictions are important.

  1. Unique ids can be a maximum of ten (10) characters in length.
  2. Unique ids may only contain the standard alphabetic characters (A-Z and a-z), numeric characters (0-9), and the underscore (‘_’).
  3. While it is technically legal for a unique id to start with a numeric character (0-9), it is generally NOT a good idea to do so. If a unique id begins with a numeric character, it will not be able to be used in most scripts, rules, and tag expressions (since starting with a numeric character causes Hero Lab to think the unique id is a numeric value).
  4. All unique ids must be unique within a defined context. For example, it is not valid to have two different tag groups with the unique id “mygroup”. However, it IS perfectly reasonable to have a tag group named “mine” and a rule set that is also named “mine”, since they represent different contexts.

NOTE! The notable exception to #3 above is for tags, where purely numeric ids are common (to represent ranges, levels, resource costs, etc.). Since tags are always referenced with their tag group, a purely numeric tag id incurs none of the liabilities mentioned above.