Dictionary object in vbscript, Visual Basic Programming

Assignment Help:

The Dictionary object stores data as key, item pairs. A Dictionary object is the corresponding of a PERL associative array. Items, that can be any form of data, are stored in the array. Each item is related with a unique key. The key is utilized to retrieve an individual item & is an integer or a string usually, however can be anything except an array.

The following code shows how to create & use a Dictionary object:

Dim d  'Create a Script Level variable

Set d = CreateObject("Scripting.Dictionary")

Sub cmdAdd_OnClick

d.Add "0", "Amar"     'Add some keys and items d.Add "1", "Bunty"

d.Add "2", "Chaman"

a = d.items

For i = 0 To d.Count document.frmForm.Elements(i).Value = a(i)

Next

End Sub

Sub cmdExist_onClick

d.Add "a", "Amar"     'Add some  keys and items. d.Add "b", "Bunty"

d.Add "c", "Chaman" If d.Exists("c") Then

msgbox "C key exists."

Else

msgbox "C key does not exist." End If

End Sub

Sub cmdKey_onClick

d.Add "a", "Amar"     'Add some keys and items. d.Add "b", "Bunty"

d.Add "c", "Chaman"

d.Key("c") = "d"        'Set key for "c" to "d". End Function

End Sub

Sub cmdKeys_onClick

d.Add "a", "Amar"     'Add some  keys and items. d.Add "b", "Bunty"

d.Add "c", "Chaman" a = d.keys

For i = 0 To d.Count document.frmForm.Elements(i).Value = a(i)

Next

End Sub

Sub cmdRemove_onClick

d.Add "a", "Amar"     'Add some  keys and items. d.Add "b", "Bunty"

d.Add "c", "Chaman"

d.Remove("b")

a = d.keys

For i = 0 To d.Count document.frmForm.Elements(i).Value = a(i)

Next

End Sub

Sub cmdCompareMode_onClick d.CompareMode = vbTextCompare

d.Add "a", "Amar"      'Add some keys and items. d.Add "b", "Bunty"

d.Add "c", "Chaman"

d.Add "B", "Baltimore"   'Add method fails on this line because the

'letter b exists already in the Dictionary.

End Sub


Related Discussions:- Dictionary object in vbscript

XML document, Write a XML with database with book details (BOOK ID, Title, ...

Write a XML with database with book details (BOOK ID, Title, Author, subject, published Year, language, vendor, price)

Visual basic program, Create the flowcharts using MS Visio, MS Excel or MS ...

Create the flowcharts using MS Visio, MS Excel or MS Word to demonstrate the algorithm. Submit your flowchart under the assignment for CH7-4-26 Flowchart. Part Printouts H

Vbscript dictionary object properties, Just like normal objects Dictionary ...

Just like normal objects Dictionary object also has definite properties. These properties can be set to any valid value & can be retrieved as and while required. Pr

For next loop - vbscript, You can employ For...Next statements to run a blo...

You can employ For...Next statements to run a block of statements a specific number of times. For loops, employ a counter variable whose value is increased or decreased with each r

Event-driven programming - windows programming, Event-Driven Programming: ...

Event-Driven Programming: The Event-driven programming allows the program to react to various inputs or events.   The action on a graphical component is an event. For il

Displaying the database - data control, Displaying The Database: The T...

Displaying The Database: The Text box, image box, check box, labels, picture box can be bounded to the data control for exhibiting the data base contents. The two properties a

Messages - visual basic programming, MESSAGES The Windows-based applica...

MESSAGES The Windows-based applications do not make explicit function calls to acquire input. They wait for the system to pass the input to them. The system passes input to the

Visual interface design, VISUAL INTERFACE DESIGN Instead of the graphic...

VISUAL INTERFACE DESIGN Instead of the graphic nature of the program, only the visualness of the inter action is important. The program must not focus on the GUI. On the other

Introduction to database applications , INTRODUCTION TO DATABASE APPLICATIO...

INTRODUCTION TO DATABASE APPLICATIONS   In this section, we define a dialog and tab order that is the order in which the controls will be navigated during the execution. The D

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd