Assume that you want to insert a privately declared function named Test into a class named TTestClass.
The new function shall have two arguments i and j, both of the integer type and it should return a boolean value.
To add such a function you should specify the following options in the Add Method dialog box:
- Type Test in Method name.
- Select the TTestClass class name in the Add to class combo box.
- Type I : Integer; J : Integer in the Arguments field.
- Check on the function option in the Method type group, then select boolean in the Return type combo box.
- Check ON the private option in the Visibility group.
- Click OK. The Class Explorer will add the following code for the function with the specified options:
- into declaration of the TTestClass class: TTestClass = class .... private function Test(I : Integer; J : Integer): boolean; .... end;
- into implementation section of the unit file:
function TTestClass.Test(I : Integer; J : Integer): boolean;
begin
end;