VarErrorSCode Procedure

Returns the error code for a vtError variant.

Syntax

[ lError = ] VarErrorSCode (pv)

The VarErrorSCode procedure syntax has the following parts:

 

Name

Type

Description

lError

Long

The error code (SCODE)

pv

Var Variant

A Variant

Comments

If the VarType of the given variant is not vtError, then this procedure returns 0.

Example

! For example, varParam3 is an optional parameter of type Variant,

! The following code tests if the caller omitted that parameter

if VarErrorSCode(vParam3)=0x80020004 ! DISP_E_PARAMNOTFOUND

! supply default value

endif

See Also

Variant Data Type, VarType