Class Module 41 Members

Convert Values Class

Entisoft Tools 2.0 Object Library · ConvertValues · 35 Functions · 2 Properties · 3 Subroutines

Showing 41 of 41
Declarations
Declarations
These functions convert values from one data type to another. Copyright 1998 Entisoft
Section
EmptyValue
Empty Value
Return an Empty value (a Variant with a VarType of vbEmpty).
Property
NullValue
Null Value
Return a Variant of type Null (a Variant with a VarType of vbNull).
Property
BlankToNull
Blank To Null
Replace an empty string with a Null value. Leave all other types of values unchanged.
Function
BlankToValue
Blank To Value
Replace Empty, Null, and empty String values with some other value. Leave all other types of values unchanged.
Function
CBoolIgnErr
C Bool Ign Err
"Convert To Boolean Ignore Errors" Attempt to convert vValue to a Boolean value. Return vValue as a Boolean value if the conversion was successful. Return False if vValue could not be converted to a Boolean.
Function
CByteIgnErr
C Byte Ign Err
"Convert To Byte Ignore Errors" Attempt to convert vValue to a Byte value. Return vValue as a Byte value if the conversion was successful. Return 0 (zero) if vValue could not be converted to a Byte.
Function
CCurIgnErr
C Cur Ign Err
"Convert To Currency Ignore Errors" Attempt to convert vValue to a Currency value. Return vValue as a Currency value if the conversion was successful. Return 0 (zero) if vValue could not be converted to a Currency.
Function
CDateIgnErr
C Date Ign Err
"Convert To Date Ignore Errors" Attempt to convert vValue to a Date value. Return vValue as a Date value if the conversion was successful. Return the Date represented by the number 0 (zero) if vValue could not be converted to a Date.
Function
CDblIgnErr
C Dbl Ign Err
"Convert To Double Ignore Errors" Attempt to convert vValue to a Double (precision floating-point) value. Return vValue as a Double value if the conversion was successful. Return 0 (zero) if vValue could not be converted to a Double.
Function
CDecIgnErr
C Dec Ign Err
"Convert To Decimal Ignore Errors" Attempt to convert vValue to a Decimal value. Return vValue as a Decimal value if the conversion was successful. Return Empty if vValue could not be converted to a Decimal.
Function
CIntIgnErr
C Int Ign Err
"Convert To Integer Ignore Errors" Attempt to convert vValue to an Integer value. Return vValue as an Integer value if the conversion was successful. Return 0 (zero) if vValue could not be converted to an Integer.
Function
CLngIgnErr
C Lng Ign Err
"Convert To Long Ignore Errors" Attempt to convert vValue to a Long (Integer) value. Return vValue as a Long value if the conversion was successful. Return 0 (zero) if vValue could not be converted to a Long.
Function
CSngIgnErr
C Sng Ign Err
"Convert To Single Ignore Errors" Attempt to convert vValue to a Single (precision floating-point) value. Return vValue as a Single value if the conversion was successful. Return 0 (zero) if vValue could not be converted to a Single.
Function
CVarIgnErr
C Var Ign Err
"Convert To Variant Ignore Errors" Attempt to convert vValue to a Variant (either string or numeric) value. Return vValue as a Variant value if the conversion was successful. Return Empty if vValue could not be converted to a Variant.
Function
CVDateIgnErr
CV Date Ign Err
"Convert To Date Ignore Errors" Attempt to convert vValue to a Date value. Return vValue as a Date value if the conversion was successful. Return the Date represented by the number 0 (zero) if vValue could not be converted to a Date.
Function
EmptyToBlank
Empty To Blank
Replace an Empty value with a blank String. Leave all other types of values unchanged.
Function
EmptyToNull
Empty To Null
Replace an Empty value with a Null value. Leave all other types of values unchanged.
Function
EmptyToValue
Empty To Value
Replace Empty values with some default value. Leave all other types of values unchanged.
Function
EqualQuotedValue
Equal Quoted Value
Returns the string expression which can be used within a Microsoft SQL WHERE clause to search for the value vValue.
Function
LengthOfType
Length Of Type
Returns the length of the internal representation of any type of value. For Empty and Null variants, returns a length of zero. For other non-strings, the length is the number of bytes occupied by the variable.
Function
MostCapableDataType
Most Capable Data Type
Returns the VarType of the most CAPABLE of the data types of the two arguments. The most capable data type is the one which has the widest range of values and is capable of representing vOne.
Function
NonZeroToTrue
Non Zero To True
Return true if the argument is a non-zero numeric, date, numeric string, or date string value. Function returns False in all other cases.
Function
NullToBlank
Null To Blank
Replace a Null value with a blank String. Leave all other types of values unchanged.
Function
NullToValue
Null To Value
Replace Null values with some default value. Leave all other types of values unchanged.
Function
PromoteToMostCapableDataType
Promote To Most Capable Data Type
Possibly promotes one of two arguments to the more CAPABLE data type. The most capable data type is the one which has the widest range of values and is capable of representing both arguments.
Function
ReplaceValue
Replace Value
"Replace One Value With Another Value" Replaces some specific value with another value. Returns all other values unchanged. Generally only supports numeric and string values.
Function
ReplaceValueOfType
Replace Value Of Type
"Replace One Value Of A Specific Type With Another Value" Replaces some specific value of a specific type with another value. Returns all other values unchanged. Generally only supports numeric and string values.
Function
ReplaceVarTypeWithValue
Replace Var Type With Value
"Replace All Values Of A Specific Type With Another Value" Replaces all values which have a specific data type with another value. Returns all other values unchanged. Generally only supports numeric and string values.
Function
VariantIsBlank
Variant Is Blank
Return True if argument is Empty, Null, or a blank String. Function returns False otherwise.
Function
VariantOfType
Variant Of Type
Return a value of the specified data type.
Function
VariantStringToVariant
Variant String To Variant
"Variant String To Variant Value" or "Variant Value From Variant String" Converts from a "Variant String" back to the original value. For the purposes of this function, a "Variant String" is one which represents some type of value and also contains information about the type of value being represented. Inverse of the VariantToVariantString function.
Function
VariantToCString
Variant To C String
Convert a value into a C string (a string with a Nil (Chr$(0)) terminating character). This function is usually used to prepare Visual Basic strings for passing to C language DLLs such as the Windows API functions. This function should only be used to pass strings to Windows API functions which cannot possibly lengthen the string.
Function
VariantToFixedCString
Variant To Fixed C String
Create a C string of length vCStringSize and copy vBasicString into it. Normally used to allocate a string with enough space to receive a string value back from Windows API function calls.
Function
VariantToString
Variant To String
Converts any type of Variant into a string. Null and Empty is converted to a zero-length string.
Function
VariantToVariantString
Variant To Variant String
"Variant Value To Variant String" or "Variant String From Variant Value" Represents any type of value as a "Variant String." For the purposes of this function, a "Variant String" is one which represents some type of value and also contains information about the type of value being represented. Inverse of the VariantStringToVariant function.
Function
VariantToVBConstExpression
Variant To VB Const Expression
"Variant To Visual Basic Constant Expression" Return the string representation of any type of value as it would appear within Visual Basic code.
Function
VariantToVBEvalExpression
Variant To VB Eval Expression
"Variant To Visual Basic Eval Expression" Return the string representation of any type of value as it would appear within a Visual Basic (non-Const) expression. Converts the value of a variant into a string that can be passed to the Eval function (in Access and Excel only).
Function
SetVariants
Set Variants
Sets one argument to the value of another. Assumes that the arguments are of compatible types.
Sub
SwapNonObjects
Swap Non Objects
Swap two values that are not Objects or DataObjects. Assumes that the arguments are of compatible types.
Sub
SwapVariants
Swap Variants
Swap two values. Assumes that the arguments are of compatible types.
Sub