AddMethod overload problem
Hi all,
I am trying to set the column width separately for each column in a crossview by adding a procedure with fast script in Delphi XE6:
function TForm1.CallMethod(Instance: TObject; ClassType: TClass; const MethodName: String; var Param1: Integer; var Param2: Variant; var Param3: Extended): Variant;
begin
Cross1OnCalcWidth(Param1, Param2, Param3);
end;
procedure TForm1.Cross1OnCalcWidth(ColumnIndex: Integer; const ColumnValues: Variant; var Width: Extended);
begin
if ColumnIndex = 6 then
Width:= 200
else if ColumnIndex = 7 then
Width:= 200
else
Width:= 100;
end;
procedure Button1.Click(Sender: TObject);
fsScript1.Clear;
fsScript1.Parent := fsGlobalUnit;
fsScript1.SyntaxType := 'PascalScript';
fsScript1.AddMethod('procedure Cross1OnCalcWidth(ColumnIndex: Integer; ColumnValues: Variant; var Width: Extended)', CallMethod);
if fsScript1.Compile then
begin
fsScript1.Execute
end
else
begin
ShowMessage(fsScript1.ErrorMsg);
end;
end;
I get the following error message: [dcc32 Error] uMain.pas(776): E2250 There is no overloaded version of 'AddMethod' that can be called with these arguments.
In the Fast Script manual the AddMethod are given two parameters, but in Delphi it requires four parameters, the two extra are strings and I have no idea what they should be.
Can anyone help me?
Thanks.
I am trying to set the column width separately for each column in a crossview by adding a procedure with fast script in Delphi XE6:
function TForm1.CallMethod(Instance: TObject; ClassType: TClass; const MethodName: String; var Param1: Integer; var Param2: Variant; var Param3: Extended): Variant;
begin
Cross1OnCalcWidth(Param1, Param2, Param3);
end;
procedure TForm1.Cross1OnCalcWidth(ColumnIndex: Integer; const ColumnValues: Variant; var Width: Extended);
begin
if ColumnIndex = 6 then
Width:= 200
else if ColumnIndex = 7 then
Width:= 200
else
Width:= 100;
end;
procedure Button1.Click(Sender: TObject);
fsScript1.Clear;
fsScript1.Parent := fsGlobalUnit;
fsScript1.SyntaxType := 'PascalScript';
fsScript1.AddMethod('procedure Cross1OnCalcWidth(ColumnIndex: Integer; ColumnValues: Variant; var Width: Extended)', CallMethod);
if fsScript1.Compile then
begin
fsScript1.Execute
end
else
begin
ShowMessage(fsScript1.ErrorMsg);
end;
end;
I get the following error message: [dcc32 Error] uMain.pas(776): E2250 There is no overloaded version of 'AddMethod' that can be called with these arguments.
In the Fast Script manual the AddMethod are given two parameters, but in Delphi it requires four parameters, the two extra are strings and I have no idea what they should be.
Can anyone help me?
Thanks.