CrGlobal: TypeConvertBasic

TypeConvertBasic

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

 Public Function TypeConvertBasic(
	  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.

See Also

Project crgenlib Overview Class CrGlobal Overview CrGlobal Properties CrGlobal Methods TypeConvert ValueInList