CrGlobal: TypeConvert

TypeConvert

convert the given value to the given data type (arrays supported)

 Public Function TypeConvert(
	  ByVal Value As Variant,
	  ByVal Type_ As VbVarType,
	  Optional ByVal FallBackToDefault As Boolean = False ) As Variant

Parameters

Value
[ByVal] Variant. value
Type_
[ByVal] VbVarType. data type
FallBackToDefault
[ByVal] Optional. Boolean. whether to fall back to the destination type's default value if the given value does not fit the given type  

Default: False

Return Values

Variant -  converted (or possibly defaulted) value

Remarks

This will return Empty if bad arguments are passed.
vbArray support is limited to one dimension.

See Also

Project crgenlib Overview Class CrGlobal Overview CrGlobal Properties CrGlobal Methods TypeClass TypeConvertBasic