Returns the error code for a vtError variant.
[ 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 |
If the VarType of the given variant is not vtError, then this procedure returns 0.
! 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