How to define overload methods?

How to define overload methods like System.Math.Max?

TMS Scripter internal variables are not strongly typed, and there is no concept of overload methods. You should simply check the number of passed parameters and their types and properly call the Delphi method. For example:




procedure CreateListForm(TableID, KeyFieldID : Integer; FValues : Array of Variant;
  DesignMode : Boolean = False);




MainScripter.DefineMethod("CreateListForm", 4 {number of total parameters}, tkNone, nil,
    CreateListFormProc, false, 1 {number of default parameters});




procedure TfrmMACSMain.CreateListFormProc(AMachine: TatVirtualMachine);
begin
 With AMachine do begin
   Case InputArgCount of
     3: CreateListForm(GetInputArgAsInteger(0), GetInputArgAsInteger(1),
     GetInputArg(2));
     4: CreateListForm(GetInputArgAsInteger(0), GetInputArgAsInteger(1),
     GetInputArg(2), GetInputArgAsBoolean(3));
   end;
 end;
end;