CVar Function

Description

Converts an expression to a Variant.

Syntax

CVar(expression)

The expression argument is any valid numeric or string expression.

Remarks

In general, you can document your code using the data type conversion functions to show that the result of some operation should be expressed as a particular data type rather than the default data type. For example, use CVar to force the result to be expressed as a Variant.

See Also

Data Type Summary.

Example

This example uses the CVar function to convert an expression to a Variant.


MyInt = 4534    ' MyInt is an Integer.
MyVar = CVar(MyInt & "000")    ' MyVar contains 4534000.