Estimating Runtime in DelphiWebScript

The delphi application runs scripts using JvInterpreter (from the Jedi project).

The function I use is evaluating expressions at runtime.
Script Example:

[...]
ShowMessage(X_SomeName);
[...]

JvInterpreter does not know X_SomeName. When an X_SomeName value is required, the script calls its OnGetValue callback. This indicates the function that I am processing. There I search for the value of X_SomeName and return it. Then JvInterpreter calls ShowMessage with the value I provided.

Now I am considering switching to DelphiWebScript as it has a proper debugging interface and should also be faster than JvInterpreter.

Problem: I did not find an obvious way to implement what JvInterpreter does with its OnGetValue / OnSetValue functions.

X_SomeName should be considered (and actually in most cases) a variable that is processed by the host application.

Any ideas?

Thank!

+5
source share
1 answer

You can do this through the language extension mechanism, which has the FindUnknownName method, which allows you to register characters in place.

It is used in a demonstration of the asm lib module, and you can also check out the AutoExternalValues ​​test case in ULanguageExtensionTests, which should be closer to what you are after.

+1
source

All Articles