Signature (Visual Basic / VBA)
Public Function VariantToVBEvalExpression( _
ByVal vValue As Variant _
) As String
Code Example
VariantToVBEvalExpression(False) = "False"
VariantToVBEvalExpression(CInt(2)) = "2%"
VariantToVBEvalExpression(CSng(2)) = "2!"
VariantToVBEvalExpression(CByte(2)) = "CByte(2)" ' #4
VariantToVBEvalExpression(#4/5/96#) = "#4/5/96#"
VariantToVBEvalExpression("Word") = """Word"""
VariantToVBEvalExpression(Null) = "Null"
Parameters
| Parameter | Description |
|---|---|
| vValue | The value which is to be converted to its representation within Visual Basic expressions. Function generates an error when passed things like object pointers which have no string representation. |
Notes & Version History
| Note | Bytes represented with the CByte() function as in example #4. |
| v1.5 Change | This function has been extended to support the new Decimal data type in VB 6.0, |