Introducing functions and object libraries

Because VBScript and JScript do not have native include, although it is possible to implement include, it is not very convenient in DOpus, DOpus can join an object, such as Dopus.Library can include user-defined VBScript functions, classes and JScript objects therein, and can make two-way calls (Multiple engines, similar to *.wsf file), The functions, procedures, classes, objects, constants, and so on, you can use Dopus.Library.xxx customization in JScript (VBScript).

For example, I wrote a function with VBScript

Function IIf (ByVal Expression, ByVal TruePart, ByVal FalsePart)
If Expression then IIf = TruePart Else IIf = FalsePart
End Function

Then the libraries can be invoked in VBScript or JScript after introducing the Dopus

Aa=dopus.Library.iif(True, "true", "false")

There is a dedicated thread about this topic, using Windows Script Components to get very near to what you describe. A search for WSC or "Script Components" should get you there.

Thank you for your reply, but that is not what I want, because after exporting USB, you need to register the component in advance on other computers.

https://msdn.microsoft.com/en-us/subscriptions/downloads/15x4407c(v=vs.84).aspx

I want to implement a function like this, but Diectory Opus does not seem to support *.wsf files.

You can load these Windows Script Components directly without registering them first.
Afaik and iirc you can mix code in these componentes as well, so basically, that's your *.wsf file.

Can you give me an example?
Thank you !

Did you read all in here?: HowTo: Create a function-library with Windows Script Components (WSC)

Somewhere down the thread there is a post about loading the wsc files directly by just using a path, no registration required.

Thank you for your prompt!
I didn't read it carefully.