Abilities are identifiers that enable you to group similar project configurations and simplify the process of managing preprocessor code.
When you create an ability, you associate it with one or more project configurations that support a specific attribute or set of attributes. You can then associate the ability with one or more code blocks that support the attribute. If you later need to add or remove configurations, you won't have to go through all your code and associate the configuration with each code block. Instead, you need only to associate the configuration with an ability. The configuration is then automatically associated with any code block that is associated with the ability.
For example, you might write an application for six devices, three of which
support a single screen size. You can create an ability named smallscreen
,
and associate it with the three project configurations. You can then associate
the single ability with code blocks that support the specific screen size. If
you decide later to support an additional device, you need only to associate
the new project configuration with the smallscreen
ability, and
the ability will be associated with all the relevant code blocks.
Ability values can be integer numbers, strings or empty symbols used as booleans. Internally they are all treated as strings. When preprocessed, however, if it is determined that the value the variable holds is an integer, they are treated as integers and compared as such. Comparisons should not be done on different variable types. However, such comparisons do not break the build process. If different variable types are compared, the preprocessor issues a warning in the Editor and Output windows and evaluates the expressions, treating abilities on both sides of the operator as Strings.