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

Creation of the menu in visual basic, Creation of the Menu in VB 1. Ini...

Creation of the Menu in VB 1. Initiate a new project by choosing a file and then new project. 2. Now select the Standard EXE as the Project type. 3. Build the Form1 activ

Application Deployment , I would like to know how to deploy a VB.NET Applic...

I would like to know how to deploy a VB.NET Application using SQL SERVER as a back-end database

Programming, i have connected my visual basic 2010 express in ports and use...

i have connected my visual basic 2010 express in ports and use it to send sms but it failed... now my teacher said that i have to use my LAN not port to send it instead..... please

Steps for creating a multiple document interface (mdi) form, Steps for Crea...

Steps for Creating A MDI Form: 1. Build a new form and set IsMdiContainer property to true. 2. Build a child form class to add to the form. 3. Now Right click the proj

What is meant by dtd?, Question 1 Design a form based applications using l...

Question 1 Design a form based applications using labels, text boxes, and buttons to perform basic arithmetic operations on integers Question 2 Describe the concept of Except

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

Features of user interface design, FEATURES OF USER INTERFACE DESIGN Th...

FEATURES OF USER INTERFACE DESIGN The features like how will the software's are used? Who will be the users? What will be the life of the software? During its lifetime how ofte

Introduction to controls and toolbars, INTRODUCTION TO CONTROLS AND TOOLBAR...

INTRODUCTION TO CONTROLS AND TOOLBARS The Visual Basic programming is an event driven programming. In the form objects the termed controls are placed. We can put the properties

Project on VB6.0, I need a VB6 software for making a soccerboard for 10 tea...

I need a VB6 software for making a soccerboard for 10 teams & automatically generate their fixtures

Cell phone application, to dial a person''s 10 digit number and assign it t...

to dial a person''s 10 digit number and assign it to their name

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