A description of each property and method of IScriptControl can be seen in Figure 2 . Notice that IScriptControl has methods for managing the entire scripting process, including setting the language, allowing or disallowing the script to participate in the UI, adding code and objects to the script, and retrieving the various parts of a script. The methods and properties in IScriptControl describe the control s object model. In addition to holding the Active Scripting site required by the scripting engine, the ScriptControl maintains its own internal object model. The top-level object of the ScriptControl object model is the module.
Most scripts are collections of procedures.
In Active Scripting parlance, this is known as a module. The ScriptControl holds a single global module by default, appropriately named global. It s the first one you ll encounter when iterating through the module collection. By default the global module is where the ScriptControl manages the script code inserted by the client. For example, the functions AddCode, ExecuteStatement, Eval, and Run within the IScriptControl interface act on the main global module.