VarDiv Function
Returns the result from dividing two variants.
HRESULT VarDiv( LPVARIANT pvarLeft, LPVARIANT pvarRight, LPVARIANT pvarResult );
The function returns one of the following:
If | Then |
|---|---|
Both expressions are of the string, date, character, boolean type | Double is returned. |
One expression is a string type and the other a character | Division and a double is returned. |
One expression is numeric and the other is a string | Division and a double is returned. |
Both expressions are numeric | Division and a double is returned. |
Either expression is NULL | NULL is returned. |
pvarRight is empty and pvarLeft is anything but empty | DISP_E_DIVBYZERO |
pvarLeft is empty and pvarRight is anything but empty | 0 as type double is returned. |
Both expressions are empty | DISP_E_OVERFLOW |