contents   index   previous   next



VariantUI4From<VarType>

 

f90VB Modules

 

f90VBDefs, f90VBVariants

Summary

 

Set of low-level subroutines to convert variant data types to an unsigned 4-byte integer.

Syntax

 

subroutine VariantUI4FromUI1 (VarSrc, VarDest, iRet)

integer(BYTE_KIND),intent(in)::  VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromI1 (VarSrc, VarDest, iRet)

integer(BYTE_KIND),intent(in)::  VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromI2 (VarSrc, VarDest, iRet)

integer(SHORT_KIND),intent(in)::  VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromUI2 (VarSrc, VarDest, iRet)

integer(SHORT_KIND),intent(in)::  VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromI4 (VarSrc, VarDest, iRet)

integer(LONG_KIND),intent(in)::  VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromR4 (VarSrc, VarDest, iRet)

real(FLOAT_KIND),intent(in)::  VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromR8 (VarSrc, VarDest, iRet)

real(DOUBLE_KIND),intent(in)::  VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromCy (VarSrc, VarDest, iRet)

type(CURRENCY),intent(in)::  VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromDec (VarSrc, VarDest, iRet)

type(DECIMAL),intent(in):: VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromDate (VarSrc, VarDest, iRet)

real(DATE_KIND),intent(in):: VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromBool (VarSrc, VarDest, iRet)

integer(VAR_BOOLEAN_KIND),intent(in):: VarSrc
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromStr (VarSrc, lcid, dwflags, VarDest, iRet)

integer(BSTRHNDL_KIND),intent(in):: VarSrc
integer(LCID_KIND),intent(in):: lcid
integer(DWORD_KIND),intent(in):: dwflags
integer(LONG_KIND),intent(out)::  VarDest
integer(HRESULT_KIND),intent(out):: iRet

 

subroutine VariantUI4FromDisp (VarSrc, lcid, VarDest, iRet)

integer(POINTER_KIND),intent(in):: VarSrc
integer(LCID_KIND),intent(in):: lcid
integer(LONG_KIND),intent(out):: VarDest
integer(HRESULT_KIND),intent(out):: iRet

Arguments

 

VarSrc [Input]

Value to coerce.

 

VarDest [Output]

Coerced value.

 

iRet [Output]

Upon return, iRet contains S_OK or an error code. See comments for more information.

 

lcid [Input]

A locale identifier.

 

dwflags [Input]

Flags that control the coercion of VarSrc. The only defined flag is LOCALE_NOUSEROVERRIDE, which forces the use of the system default locale settings, rather than custom locale settings.

Comments

 

These functions are direct wrappers to low-level functions provided by Windows’ OLE API. Rather than coding your own conversion functions, you should use these subroutines to ensure OLE-compliant conversion of variant types.

Argument iRet

 

Indicates success or failure of the subroutine. The following codes can be returned in this argument:

 

 

Value returned in argument iRet Description
S_OK Success.
DISP_E_BADVARTYPE One or both of the passed variant types are not a valid type of variant.
DISP_E_TYPEMISMATCH At least one of the variants could not be coerced to the appropriate type for this operation.
E_INVALIDARG One of the arguments is invalid.
E_OUTOFMEMORY Memory could not be allocated for the operation..
DISP_E_OVERFLOW The data pointed to by VarSrc does not fit in the destination type.

Related Topics

 

For information about: See:
Changing the type of a variant VariantChangeType
Initializing a variant VariantInit
Copying a Variant VariantCopy, VariantCopyInd
Creating new variants VariantCreate

 

 


VariantXor