IVsaScriptScope.AddItem Method

Used as a factory for child items that can be added to a scope, for example, script blocks, expressions, statements, host objects, host scopes, and script scopes.

Namespace: Microsoft.JScript
Assembly: Microsoft.JScript (in microsoft.jscript.dll)

'Declaration
Function AddItem ( _
	itemName As String, _
	type As VsaItemType _
) As IVsaItem
'Usage
Dim instance As IVsaScriptScope
Dim itemName As String
Dim type As VsaItemType
Dim returnValue As IVsaItem

returnValue = instance.AddItem(itemName, type)
IVsaItem AddItem (
	String itemName, 
	VsaItemType type
)
function AddItem (
	itemName : String, 
	type : VsaItemType
) : IVsaItem
Not applicable.

Parameters

itemName

A string name for the new item. The name must not be in use; otherwise an ItemNameInUseVsaException is thrown.

type

The VsaItemType Enumeration was fixed and new item types were added. The JScript implementation accepts VSAITEMTYPE2 values and rejects VsaItemType items

In the JScript implementation, the VSA engine must not be closed; otherwise an EngineClosedVsaException is thrown.

In the JScript implementation, the item name must not be already in use; otherwise an ItemNameInUseVsaException is thrown.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: