8000 Custom function registered to DWScript and support nested parameters and nested eval? · Issue #19 · EricGrange/DWScript · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Custom function registered to DWScript and support nested parameters and nested eval? #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wqmeng opened this issue May 31, 2025 · 0 comments

Comments

@wqmeng
Copy link
wqmeng commented May 31, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0