为 vbscript 实现即时 window

Implement immediate window for vbscript

我已经使用 C# 实现了调试器。它使用 MSSCRIPT.ocx 作为 vbscript 引擎。 谁能告诉我如何在其中实现即时 window 功能。

所需功能:

应显示所有可用变量及其值:

例如

i = 1

j = i+2

[断点]

k = 3

遇到断点,立即window应该显示i=1,j=3

有什么方法可以在运行时从 vbscript 代码中获取变量?

MSScript 封装了一大堆接口。

SUMMARYActive Scripting is a powerful tool for adding advanced features such as macro capabilities to custom applications. This creates a need for integrated debugging services for new features added with scripting. To address this need, Microsoft has provided a set of COM interfaces for developing debugging services from within the Active Scripting framework.

This article illustrates how to use the debugging services published within the Active Scripting framework to create a full-featured script debugger that can provide a multitude of debugging actions including setting breakpoints, call stack viewing, variable browsing, immediate-window viewing, thread enumeration, and application enumeration.

活动脚本 API:为您的脚本托管应用程序添加强大的自定义调试功能

https://msdn.microsoft.com/en-us/magazine/cc301316.aspx

以及 1000 万个接口。 https://msdn.microsoft.com/en-us/library/6dy78b76(v=vs.94).aspx

这就是关于使用脚本控件的帮助内容。

To make implementation of the host as flexible as possible, an OLE Automation wrapper for Windows Script is provided. However, a host that uses this wrapper object to instantiate the scripting engine does not have the degree of control over the run-time name space, the persistence model, and so on, that it would if it used Windows Script directly.

话虽如此,您可以在您的脚本中添加您自己的代码来执行评估和执行。