Show/Hide Toolbars

TMS Data Modeler Documentation

Navigation: TMS Aurelius Export > Customization Script

Creating a New Method Function in a Class

Scroll Prev Top Next More

This example creates a public method Triple in class TEmployees:

 

procedure OnClassGenerated(Args: TClassGeneratedArgs);     
var
  Func: TCodeMemberMethod;
begin
  case Args.CodeType.Name of
    'TEmployees':
      begin
        Func := Args.CodeType.AddFunction('Triple''double', mvPublic);
        Func.AddParameter('Value''double');
        Func.AddSnippet('Result := Value * 3;');        
      end;              
  end;                                                   
end;                             

 

It will create the following method declaration and implementation:

 

    function Triple(Value: double): double;

 

 

function TEmployees.Triple(Value: double): double;
begin
  Result := Value * 3;
end;