-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Hello,
I have try to add my custom functions such as Func_A, Func_B and Func_C to DWScript and use them in a Script. By adding TdwsFunction, It seems not work well with nested paramters eval.
LFunc := Self.dwsUnit.Functions.Add;
LFunc.Name := 'Func_A';
LFunc.Overloaded := true;
LFunc.ResultType := 'Integer';
LFunc.OnEval := dwsUnitFunctions_Func_A_Eval; //
LFunc.Parameters.Add('P1', 'String');
LFunc.Parameters.Add('P2', 'String');
LFunc.Parameters.Add('P3', 'Integer');
If the above function Func_A, I would like to call it in script as Func_A(Func_B, Func_C, 10); And even more nested as FuncA(Func_B + Func_C, 'Hello', .... , Seems that the parameter could not pass in as a Expression but a 'String'.
Should I use TFuncSymbol and assign a implmentation of the IExecutable to support the nest eval, or Should I use Something from dwsExprs such as TExprBase to support nested eval in my custom functions Func_A, ...?
Do you have a example to achieve it?
Thank you very much.
Metadata
Metadata
Assignees
Labels
No labels