contents   index   previous   next



VariantI2From<VarType>

 

f90VB Modules

 

f90VBDefs, f90VBVariants

Summary

 

Set of low-level subroutines to convert variant data types to a signed 2-byte integer.

Syntax

 

subroutine VariantI2FromUI1 (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromI1 (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromUI2 (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromI4 (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromUI4 (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromR4 (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromR8 (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromCy (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromDec (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromDate (VarSrc, VarDest, iRet)

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

 

subroutine VariantI2FromBool (VarSrc, VarDest, iRet)

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

 

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

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

 

subroutine VariantI2FromDisp (VarSrc, lcid, VarDest, iRet)

integer(POINTER_KIND),intent(in):: VarSrc
integer(LCID_KIND),intent(in):: lcid
integer(SHORT_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

 

 

 


VariantI4From