contents   index   previous   next



VariantCat

 

f90VB Modules

 

f90VBDefs, f90VBVariants

Summary

 

Returns the concatenation of two variants.

Syntax

 

type(VARIANT) function VariantCat  (VarLeft, VarRight, iRet)

type(VARIANT),intent(in)::  VarLeft
type(VARIANT),intent(in)::  VarRight
integer(HRESULT_KIND),intent(out),optional:: iRet

Arguments

 

VarLeft and VarRight [Input]

Two variant values. Must be initialized variants.

iRet [Output/Optional]

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

Comments

 

The function concatenates the two provided variants using the following rules:

 

If: Function returns a:
Both expressions are of the string type Concatenation.
Both expressions are VT_NULL NULL variant.
One expression is VT_NULL and the other is anything but NULL The type of the other is returned.
Either expression is of type VT_BOOL FALSE equal to 0 or TRUE equal to –1.
Either expression is VT_ERROR VT_NULL variant.
Both expressions are numeric Concatenation.
One expression is numeric and the other is a string Concatenation.
Either expression is of type date Date format.
Both expressions are empty Empty string.

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..

Examples

 

See example for VariantAdd.

Related Topics

 

For information about: See:
Adding variants VariantAdd, DecimalAdd, CurrencyAdd

 


VariantChangeType