Previous in Contents Next in Contents

IDataFunctions::ValidateNumber

The ValidateNumber method verifies that the specified number falls within the provided range.

Syntax

HRESULT ValidateNumber(
VARIANT vtNumber,// in
VARIANT vtMin,// in
VARIANT vtMax,// in
VARIANT *pfValid// out
);

Parameters

vtNumber
A VARIANT that contains the number on which to perform range-checking. This VARIANT's vt member can be initialized to the following types: VT_I2, VT_I4, VT_R4, VT_R8, VT_CY, VT_I1, VT_UI1, VT_UI2, VT_UI4, VT_I8, VT_INT, VT_UINT. However, prior to performing validation on this number, ValidateNumber converts it to long (VT_I4) integer.
vtMin
A VARIANT that specifies the minimum end of the range. Prior to performing the range validation, ValidateNumber converts this VARIANT to a long VARIANT (VT_I4).
vtMax
A VARIANT that specifies the maximum end of the range. Prior to performing the range validation, ValidateNumber converts this VARIANT to a long VARIANT (VT_I4).
pfValid
This out-value points to a VARIANT_BOOL VARIANT, the boolVal member of which indicates whether the vtNumber falls within the range specified by vtMin and vtMax.

Include

<commerce.h>

Return Values

Value Description
S_OK This function always returns S_OK. To determine whether or not the operation was actually successful, check the pfValid out-value.

Related Topics


© 1997-2000 Microsoft Corporation. All rights reserved.