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

Files in a visual basic project, FILES IN A VB PROJECT The project file...

FILES IN A VB PROJECT The project file has the.vbp extension. The form in which we draw has the .frm extension; .mod denotes the module file; .cls denotes the class file; .res

Objective of vb script, The objective of this unit is to describe the basic...

The objective of this unit is to describe the basics of VBScript. After completing this unit, you will be capable to write code for Web pages via VBScript. You will be able to unde

Need help in us wordpress expert, US WordPress Expert We are functioning...

US WordPress Expert We are functioning on a software application based on WordPress (BuddyPress + Event Manager). Everything as far as functionality is done. Utmost of the styli

Validation controls, Describe different validation controls of VB.net?

Describe different validation controls of VB.net?

Adding events in visual basic , Adding Events in VB   For adding the e...

Adding Events in VB   For adding the events in VB, first double click on the command button with the caption hello. The Private Sub command1_Click () and End Sub would be

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

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

Ddx - dialog data exchange, DDX - Dialog Data Exchange: The Data membe...

DDX - Dialog Data Exchange: The Data members can be related with specific controls in the dialog box. When the dialog box is displayed, the DDX will transfer the values into t

Dynamic link library - dll , DYNAMIC LINK LIBRARY - DLL   The DLL are ...

DYNAMIC LINK LIBRARY - DLL   The DLL are files which can be called when required by the other program that is running in the computer. The DLL files which support the specific

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