<-- Previous || Up || Next -->

Add Unit Function
Units Class

Public Function AddUnit( _
      ByVal vCode As String _
    , ByVal vName As String _
    , ByVal vConstant As Double _
    , ByVal vDefinition As String _
    , ByVal vCategory As String _
    ) As String

"Add Unit Definition" Registers a new measurement definition. Add a unit such as "foot = 12 inch" into the units conversion program table, or replace an existing definition. Also used to add measurement categories and measurement synonyms. Function returns an empty string upon success. Function returns the error message as a string when errors occur.

Arguments: vCode is the code or unique identifier of the unit. vName is the name and/or description of the unit. When vName is blank, vCode is used as the Name. vConstant is the numeric part of the definition of the unit. vDefinition is a string containing the symbolic part of the unit definition. vCategory is the user-specified category of the primary physical measurement described by the unit definition.
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 unit definition with the same Code, that previous definition will be overwritten by the new one.
Examples:
    estConvertAddUnit("in", "inch", .0254, "m", "length")
adds a unit identified by "in" named "inch" which is defined as .0254 meters and that describes length.
    estConvertAddUnit("inch", "", 1, "in", "")
adds a Synonym-type unit named "inch" as a synonym for the unit "in". Its category will be that of the most-recently-added unit.
    estConvertAddUnit("length", "", 1, "m", "length")
adds a Category-type unit which will be used to help determine the category described by other types of unit definitions. Notice that the Code and Category are the same. Any measurement which can be converted to meters ("m") will be described as "length".
    estConvertAddUnit("m", "meter", 1, "m", "length")
adds a Base-type unit on which other unit definitions may be based. Notice that the Code and Definition are the same--the unit is defined in terms of itself.
See Also:
    estConvertAddPrefix Function
    estConvertAddReplacement Function

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.