18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />

Property Item<br />

Description: Sets or returns an item <strong>for</strong> a specified key in a Dictionary object.<br />

Usage: Object.Item (key) [= newitem]<br />

Arguments: key<br />

Required. Is the key associated with the item being retrieved or added.<br />

newitem<br />

Optional. If provided, new item is the new value associated with the specified key<br />

Return: None<br />

Remarks: If the key is not found when changing an item, a new key is created with the<br />

specified new item. If a key is not found when attempting to return an existing<br />

item, a new key is created and its corresponding item is left empty.<br />

Example: Dim d<br />

Set d = CreateObject(“Scripting.Dictionary”)<br />

d.Add “a”, “Chicago”<br />

d.Add “b”, “New York”<br />

MyItem = d.Item(“a”)<br />

MsgBox MyItem ‘ Displays Chicago<br />

d.Item(“b”) = “Austin” ‘ Change item <strong>for</strong> key “b” to Austin<br />

Property Key<br />

Description: Sets a key in a Dictionary object.<br />

Usage: Object.Key (key) = newkey<br />

Arguments: key<br />

Required. Is the key value being changed<br />

newkey<br />

Required. New value that replaces the specified key<br />

Return: None<br />

Remarks: If the key is not found when changing a key, a new key is created and its<br />

associated item is left empty.<br />

Example: Dim d<br />

Set d = CreateObject(“Scripting.Dictionary”)<br />

d.Add “a”, “Chicago”<br />

d.Add “b”, “New York”<br />

d.Key(“a”) = “city1”<br />

d.Key(“b”) = “city2”<br />

Method Add<br />

Description: Adds the name of a dictionary object<br />

Usage: object.Add (key, item)<br />

Arguments: key<br />

Required. The key associated with the item being added. Must be unique.<br />

item<br />

Required. This is the item associated with the key being added.<br />

Return: None. Error occurs if the key already exists<br />

Example: Dim d<br />

Set d = CreateObject(“Scripting.Dictionary”)<br />

d.Add “a”, “Chicago”<br />

d.Add “b”, “New York”<br />

Method Exists<br />

Description: Determine is a specified key exists in the Dictionary object<br />

Usage: object.Exists (key)<br />

Arguments: key<br />

Required. The key value being searched <strong>for</strong><br />

Return: TRUE if a specified key exists in the Dictionary object, otherwise FALSE<br />

Example Dim d, msg<br />

Set d = CreateObject(“Scripting.Dictionary”)<br />

d.Add “a”, “Chicago”<br />

214 <strong>InduSoft</strong>, Ltd.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!