Search Results for

    Show / Hide Table of Contents

    Adding a function with var and default parameters

    You don't need to care about default parameters - they are substituted automatically by FastScript. Var parameters must be handled by you.

      fsScript1.AddMethod('function DelphiFunc(var s: String; i: Integer = 0): Boolean', CallMethod); 
    
    { the method handler }
    function TForm1.CallMethod(Instance: TObject; ClassType: TClass; const MethodName: String; 
      var Params: Variant): Variant; 
    var
      s: String;
    begin 
      s := Params[0];
      Result := DelphiFunc(s, Params[1]); 
      Params[0] := s;
    end; 
    
    Back to top © Copyright Fast Reports Inc.