VarCmp Function

Compares two variants.

HRESULT VarCmp(
    [in]  LPVARIANT  pvarLeft,
    [in]  LPVARIANT  pvarRight,
    [in]  LCID       lcid,
    [in]  ULONG      dwFlags
);

pvarLeft

[in] Points to the first variant.

pvarRight

[in] Points to the second variant.

lcid

[in] Locale identifier.

dwFlags

[in] The following are compare results flags:

Options

Value

Meaning

NORM_IGNORECASE

0x00000001

Ignore case.

NORM_IGNORENONSPACE

0x00000002

Ignore nonspacing chars.

NORM_IGNORESYMBOLS

0x00000004

Ignore symbols.

NORM_IGNOREWIDTH

0x00000008

Ignore string width.

NORM_IGNOREKANATYPE

0x00000040

Ignore Kana type.

NORM_IGNOREKASHIDA

0x00040000

Ignore Arabic kashida characters.

Options

Value

Meaning

VARCMP_LT

0

The pvarLeft is less than pvarRight.

VARCMP_EQ

1

The two parameters are equal.

VARCMP_GT

2

The pvarLeft is greater than pvarRight.

VARCMP_NULL

3

Either expression is NULL.

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.

Show:
© 2014 Microsoft