Function IdentifierUnit(identifierName)

IdentifierUnit

The function IdentifierUnit returns the unit of identifierName as it is declared.

IdentifierUnit(
     identifierName)       ! (input) scalar element parameter

Arguments

identifierName

An element expression in the predefined set AllIdentifiers specifying the identifier for which the unit should be obtained.

Return Value

This function returns a unit. If identifierName is not an identifier, an error message is issued. If identifierName is not a parameter, variable or constraint, the unit [] is returned without further warning.

Note

This function complements the suffix .unit; when the unit of an identifier is a unit parameter, this function will return that unit parameter, whilst the suffix unit will return the value of that unit parameter.

Example

Given the declaration:

Parameter p_d {
        Unit: m;
}

the code:

1    _ep_p := StringToElement(AllIdentifiers,
2            "chapterModel::sectionModelQuery::funcIdentifierUnit::p_d",
3            create: 0);
4    _up_p := IdentifierUnit( _ep_p );
5    block where single_column_display := 1, listing_number_precision := 6 ;
6            display _up_p ;
7    endblock ;

produces in the listing file:

_up_p := [m] ;

References