Add Field (C++)

From RAD Studio
Jump to: navigation, search

Go Up to View Menu

Adds a field to a class or into the global scope on the C++ Class Explorer.

On the C++ Class Explorer Window, invoke the Add Field dialog box from either:

  • The Add a new field to this class ClExplAddField.png toolbar button
  • The context menu command Add field.

Note: The Add Field context menu command and the Add a new method to this class ClExplAddField.png toolbar button are enabled only for elements that are declared in a C++ managed unit. To create a C++ unit, choose either:

  • File > New > Unit - C++Builder
  • File > New > Form - C++Builder

C++ managed units differ from ordinary C++ source files in that the header (.h) and implementation (.cpp) files are grouped together. For a C++ managed unit, the Code Editor displays a tab for the .cpp file and a tab for the .h file along the bottom of the window.

You cannot add fields, methods, or properties to VCL or FireMonkey elements using the C++ Class Explorer.


Item Description

Name

Specifies the name of the field.

Type

Specifies the type of the field. You can select one of the predefined types from the combo box or you can enter another existing type.

Visibility

Specifies the access control specifier for the field being created. Select from:


See Also