Introduction to Dictionary objects in ASP and how to use them

Source: Internet
Author: User
Tags array arrays object key

Introduction to Dictionary objects in ASP and how to use them
The Dictionary object is used to store information (equivalent to keys and items) in the name/value of a pair. Dictionary objects seem simpler than arrays, but

, the Dictionary object is a more satisfying solution for dealing with associated data.

First, let's look at the Comparative analysis of Dictionary and array:

Keys are used to identify items in the Dictionary object

You do not need to invoke ReDim to change the size of the Dictionary object

When you delete an item from Dictionary, the remaining items are automatically moved up

Dictionary is not multidimensional, and arrays are

Dictionary has more built-in objects than arrays

Dictionary works better than arrays when it accesses random elements frequently

Dictionary work better than arrays when locating items based on their content


Introduction to the properties and methods of Dictionary objects in asp:

Dictionary Property
CompareMode: Sets or returns the comparison mode used to compare keys in the Dictionary object.
Count: Returns the number of key/item pairs in the Dictionary object.
Item: Sets or returns the value of an item in the Dictionary object.
Key: Sets a new key value for the key value already in the Dictionary object.

Method
Add: Adds a new key/project pair to the Dictionary object.
Exists: Returns a logical value that indicates whether the specified key exists in the Dictionary object.
Items: Returns an array of all items in the Dictionary object.
Keys: Returns an array of all the keys in the Dictionary object.
Remove: Deletes the specified key/item pair from the Dictionary object.
RemoveAll: Deletes all key/item pairs in the Dictionary object.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.