There are two types of conditional commands that can be used with SAPROPS:
▪ifdefs and ifndefs
▪TestProcs
Ifdef command
Ifdef (if definition) tests properties selected on an encyclopedia-wide level in the Configuration Dialog box. For example, an ifdef statement in SAPROPS tests if Java properties have been turned on for the encyclopedia, and if they have, additional properties specific to Java are added to the appropriate definition, for example, class, method, and attribute definition.
If not def tests if a property has not been selected.
TestProcs command
The testproc (test procedure) conditionals examine test properties that are selected on a diagram-wide level, in the Diagram properties dialog. TestProc enables the user to present a different definition for the same exact property, depending on the test string selected for the diagram. A control statement references the property, and provides a specific occurrence of it in the Definition. For example,
▪The attribute definition, a TestProc is used to test the database property value selected for the currently open diagram. A control statement presents a different definition for the same property, Key, depending on the selected database. The same goes for other properties treated as controls: Foreign Key and Nullity, among others.
▪The data domain definition, a TestProc is used to test the database property value selected for the currently open diagram. A control statement presents a different definition for the same property, Business Unit, depending on the selected database.
Note For controls to be used, they must reference a property that is called out at the top of the definition. If a control references a property that does not exist in that definition, you will get an error while parsing USRPROPS.TXT.
In the following example, the properties Key, Foreign Key, Default Nullity, and Unique are specified the first time they are mentioned in the definition of an attribute. Later, they are referenced by control statements, in other test strings.