Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

VarCmp function

Compares two variants.

Syntax


HRESULT VarCmp(
  _In_ LPVARIANT pvarLeft,
  _In_ LPVARIANT pvarRight,
  _In_ LCID      lcid,
  _In_ ULONG     dwFlags
);

Parameters

pvarLeft [in]

The first variant.

pvarRight [in]

The second variant.

lcid [in]

The locale identifier.

dwFlags [in]

The compare results option.

ValueMeaning
NORM_IGNORECASE
0x00000001

Ignore case.

NORM_IGNORENONSPACE
0x00000002

Ignore nonspace characters.

NORM_IGNORESYMBOLS
0x00000004

Ignore symbols.

NORM_IGNOREWIDTH
0x00000008

Ignore string width.

NORM_IGNOREKANATYPE
0x00000040

Ignore Kana type.

NORM_IGNOREKASHIDA
0x00040000

Ignore Arabic kashida characters.

 

Return value

This function can return one of these values.

Return code/valueDescription
VARCMP_LT
0

pvarLeft is less than pvarRight.

VARCMP_EQ
1

The parameters are equal.

VARCMP_GT
2

pvarLeft is greater than pvarRight.

VARCMP_NULL
3

Either expression is NULL.

 

Remarks

The function only compares the value of the variant types. It compares strings, integers, and floating points, but not arrays or records.

NORM_IGNOREWIDTH causes VarCmp to ignore the difference between half-width and full-width characters, as the following example demonstrates:

"Cat"== "cat"

The full-width form is a formatting distinction used in Chinese and Japanese scripts.

Requirements

Header

OleAuto.h

Library

OleAut32.lib

DLL

OleAut32.dll

See also

Variant Arithmetic Functions
Conversion and Manipulation Functions
Automation Programming Reference

 

 

Show:
© 2016 Microsoft