Function Units Class

AddReplacement

"Add Replacement Definition" Add a global text replacement definition. Defines text which will be replaced by something else wherever it occurs within measurement expressions. Function returns an empty string upon success. Function returns the error message as a string when errors occur.

Signature (Visual Basic / VBA)

Public Function AddReplacement( _
      ByVal vFind As String _
    , ByVal vReplace As String _
    , ByVal vCompare As VbCompareMethod _
    ) As String

Code Example

    estConvertAddReplacement("feet", "foot", 1)

Return Value

Function returns an empty string upon success. It returns the error message as a string when errors occur within the function. If there is already a global text replacement definition whose Find text is the same as vFind, that previous definition will be overwritten by the new one. defines "foot" as the text that will replace "feet" wherever "feet" appears within measurement expressions. For example, the measurement expression "acrefeet/hr" would be changed to "acrefoot/hr" before being interpreted.

Notes & Version History

Arguments vFind is this string which will be replaced by something else wherever it occurs within measurement expressions. vReplace is the text which will replace every occurrence of vFind. vCompare is the Visual Basic comparison type used to find text that matches vFind.