Automating the Creation of Fields with the Class Explorer
Go Up to Object Pascal Class Explorer Topics
Using the Object Pascal Class Explorer you can automate the creation of fields
To automate the creation of fields:
- Open the Object Pascal Class Explorer window by choosing View > Class Explorer.
- In the Class Viewer pane, right-click a class into which you wish to add a new field.
- On the context menu, choose the Add Field item. The Add Field dialog box appears.
- Into Field name type the name of the field to be added.
- In the Add to class combo box, select the class to which you wish to add the field.By default, the class currently selected in the Class Viewer pane is prompted. You can, however, change this to any other available class selecting it from the drop-down list in the combo box.Select the @unitclass to add the field to the global scope.
- In the Type combo box, select the type of the field. You can select one of the predefined types from the drop-down list in the combo box or you can type in any other existing type.
- In the Visibility group, select one of the visibility specifiers. The selected visibility specifier will be applied to the field being created.
- Click OK. The code declaring the field with the specified properties will be inserted into the specified class.