Customizing the metamodel > Keywords for USRPROPS > CONTROL
  
CONTROL
The CONTROL keyword is equivalent to the Property keyword, when used with TESTPROCs to set up a switch in a definition.
There are two ways to specify that a property appears in a definition dialog depending on the value of a switch:
You can use #IFDEFs, which act upon values that you set for the encyclopedia in the Encyclopedia Configuration dialog (for example, setting the language type of the encyclopedia to Java or C++). The Encyclopedia Configuration dialog actually sets values in the SADECLAR.CFG file.
You can also specify that a PROPERTY appears in a dialog (and what its initial value is) based on a switch that is itself a property (TESTPROPERTY) in the definition dialog. For example, you can specify in an entity that its DBMS type is Oracle or SQL Server. Subsequent properties will appear or not appear in the definition, and have certain default values, based on the value that you set for DBMS type. You use the TESTPROC keyword to specify the TESTPROPERTY switch.
Use the PROPERTY keyword the first time you specify a particular property in the definition, and the Control keyword for every other occurrence of that property in the definition. The REFPROP keyword specifies which PROPERTY each CONTROL is referencing. For this reason, the CONTROL and REFPROP keywords are often used in conjunction with TESTPROCs.
Summary
For a CONTROL to be used, there must be an initial reference to the PROPERTY that the CONTROL references, at the top of the definition. The REFPROP keyword is used in conjunction with the CONTROL keyword.
Example
The example uses, the REFPROP keyword with the CONTROL keyword to specify that the “Primary Key”, “Unique”, and “Clustered” properties are provided to the Index definition when Oracle 8 is selected as the DBMS: these properties will be exactly the same as their referenced property.
Definition "Index"
{
CHAPTER "Modeling Properties"
{ TESTPROC TestPropertyNotValue
TESTPROPERTY "DBMS"
TESTSTRING { "ORACLE 8" }
}
PROPERTY "Primary Key"
{ EDIT Boolean LENGTH 1 DEFAULT "F" READONLY }
PROPERTY "Unique"
{ EDIT Boolean LENGTH 1 VALUESCRIPT ProcessIndexUnique DEFAULT "F" }
PROPERTY "Clustered"
{ EDIT Boolean LENGTH 1 DEFAULT "F" }
...
CHAPTER "Modeling Properties "
{ TESTPROC TestPropertyValue
TESTPROPERTY "DBMS"
TESTSTRING { "ORACLE 8" }
}
CONTROL "Primary Key" { REFPROP "Primary Key" }
CONTROL "Unique" { REFPROP "Unique" }
CONTROL "Clustered"{REFPROP "Clustered"}
...
}
See also
Keywords for USRPROPS