Show/Hide Toolbars

TMS Data Modeler Documentation

Navigation: TMS Aurelius Export > Customization Script

Creating a New Property in a Class

Scroll Prev Top Next More

This example creates a private string field FAdditional and public property Additional (which getter and setter refers to private field) to the class TEmployees:

 

procedure OnClassGenerated(Args: TClassGeneratedArgs);     
begin
  case Args.CodeType.Name of
    'TEmployees':
      begin
        Args.CodeType.AddField('FAdditional''string', mvPrivate);
        Args.CodeType.AddProperty('Additional''string'
          'FAdditional''FAdditional', mvPublic);
      end;              
  end;                                                   
end;                                

 

This will create the following private field and public property:

 

  private
    FAdditional: string;
  public
    property Additional: string read FAdditional write FAdditional;