Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > IDL Code > Modeling IDL code in Modeler > Creating IDL Items > Creating a constant (IDL code)
  
Creating a constant (IDL code)
You can create module scoped constants and non-module scoped constants.
To create a non-module scoped constant:
1. Right-click the Component, Connector, Message, Structure or Value Type for which you want to create a constant, point to New, and then click IDLAttribute.
2. From the Type Selector dialog, in the Types list select the type of item you want to use, that is, Basic Type, Class, Data Type, Message, Structure, Type Definition, Typedef or Value Type.
3. In Existing Type browser, select the item you want to use.
4. Type the name of the constant, and then press the Enter key.
5. Right-click the Constant, point to Links > Stereotypes, and then click CORBAConstant.
6. Open the constant's Property Pages.
7. Click the Options tab, and then select the Read Only check box.
8. Click the Data Type tab, and in theType box type the name of the type, or click theSelect button and select an item to use as the type.
9. In the Default box, type the value of the constant.
To create a module scoped constant:
1. Right-click the Package that represents the module, point to New, and then click Class.
2. Type the name Constants, and then press the Enter key. Note that the Class must be named Constants.
3. Right-click the Constants class, point to Links > Stereotypes, and then click CORBAConstants.
4. Right-click the Constants class, point to New, and then click Attribute.
5. Type the name of the constant, and then press the Enter key.
6. Right-click the constant, point to Links > Stereotypes, and then click CORBAConstant.
7. Open the constant's Property Pages.
8. Click the Options tab, and then select the Read Only check box.
9. Click the Data Type tab, and in theType box type the name of the type, or click theSelect button and select an item to use as the type.
10. In the Default box, type the value of the constant.