Clarification on passing class-type parameters into functions and procedures
I am trying to use in a beforePrint on the fastCode side a custom function registered on the code side.
The special feature of this function is that one parameter is a var class that should be returned to the pascalCode. When i call function the program gives invalid Typecast error.
After reading the documentation of fastReport i found this:
I would like to understand if in fact it is not possible to pass complex objects to procedures and functions even while registering the relevant class or if there is a way for do it.
My code:
Delphi code:
function GetTypeCliFor(var ATypeClientSupplier: TTypeCliFor): Boolean;
with Script.AddClass(TTipoCliFor, 'TComponent') do
begin
AddProperty('FlEstero', 'Integer', GetProp1);
AddConstructor('constructor Create', CallMethod);
AddMethod('procedure Free', CallMethod);
AddMethod('function ClassName: String', CallMethod);
end;
PascalScript:
procedure ValorizzaQuantita;
var
LTipoCli: TTipoCliFor;
begin
GetTipoCliFor(LTipoCli);
end;
Thank you, any opinions and suggestions are welcome.