Function Units Class

ConvertString

"Convert Measurement String" Perform the measurement conversion described by the string argument. Parse a string like "5 ft to in" and pass it to the Convert function. Accepts strings of the form "5 ft to in", "ft^2 to in^2", "5 in", and "in", etc.

Signature (Visual Basic / VBA)

Public Function ConvertString( _
    ByVal vExpression As Variant _
    ) As Variant

Code Examples

    estConvertString("5 ft to in")
    estConvertString("5 ft")

Return Value

Function returns Null when its argument is Null. Function returns the result from the call to the estConvert function otherwise. converts 5 feet to inches, returning 60. It is equivalent to the function call estConvert(5, "ft", "in") converts 5 feet to meters (the standard SI measurement for length) returning "1.524 m". It is equivalent to the function call estConvert(5, "ft", "")

Notes & Version History

Remarks This function splits the vExpr string into its "from measurement" and "to measurement" components then passes those expressions on to the estConvert function for conversion.
Arguments It expects to find strings of the form "34 feet to meters" When it does not find the phrase " to " in the string, it passes the string as the "from measurement" and passes an empty string as the "to measurement".