Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The usage of the VBS property CompareMode

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "the usage of VBS attribute CompareMode". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the usage of VBS attribute CompareMode".

Sets and returns the comparison mode for comparing string keywords in a Dictionary object.

Object.CompareMode [= compare]

Parameter object

Required. The name of the Dictionary object.

Compare

Optional. If this parameter is provided, the compare parameter is a numeric value that represents the comparison mode used by functions such as StrComp.

Set up

The compare parameter is set as follows:

ConstantValueDescriptionvbBinaryCompare0 performs binary comparisons. VbTextCompare1 performs text comparisons. Description

Values greater than 2 can be used to compare using the locale Ids (LCID) an error occurs if you try to change the comparison mode of an Dictionary object that already contains data.

The CompareMode property uses the same value as the compare parameter in the StrComp function.

The following example illustrates how to use the CompareMode property:

Dim d Set d = CreateObject ("Scripting.Dictionary") d.CompareMode = vbTextCompared.Add "a", "Athens" 'add some keys and items. D.Add "b", "Belgrade" d.Add "c", "Cairo" d.Add "B", "Baltimore" 'failed to add method on this line because the letter b already exists in Dictionary. Thank you for your reading, the above is the content of "the usage of VBS attribute CompareMode". After the study of this article, I believe you have a deeper understanding of the usage of VBS attribute CompareMode, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report