- Function IdentifierType(identifierName)
IdentifierType
The function IdentifierType
returns the type of identifierName
as an element in AllIdentifierTypes
.
IdentifierType(
identifierName) ! (input) scalar element parameter
Arguments
- identifierName
An element expression in the predefined set
AllIdentifiers
specifying the identifier for which the type should be obtained.
Return Value
This function returns a type as an element in
AllIdentifierTypes
. IfidentifierName
is not an identifier, an error message is issued.Note
This function replaces the suffix .type; this suffix is deprecated.
Example
Given the declaration:
Parameter p_d ;
the code:
1_ep_p := StringToElement(AllIdentifiers,
2 "chapterModel::sectionModelQuery::funcIdentifierType::p_d",
3 create: 0);
4_ep_type := IdentifierType( _ep_p );
5block where single_column_display := 1, listing_number_precision := 6 ;
6 display _ep_type ;
7endblock ;
produces in the listing file:
_ep_type := 'parameter' ;
And below, a common model query example:
SelectedIdentifiers := AllParameters ; ! Or some other selection.
put outf ;
outf.pagewidth := 255 ; ! Wide
put "type":20, " ", "name":32, " ", "dim ", "unit":20, " ",
"range":20, " ", "Text", / ;
put "-"*20, " ", "-"*32, " ", "--- ", "-"*20, " ", "-"*40, / ;
for ( si ) do ! For each selected identifier
put IdentifierType( si ):20, " " ! Type
si:32, " ", ! name
"(", IdentifierDimension( si ):1:0, ") ", ! dimension
IdentifierUnit( si ):20, " ", ! unit
IdentifierElementRange( si ):20, " ", ! range
IdentifierText( si ), / ! Documenting text.
endfor ;
putclose ;
See also
The functions
IdentifierDimension
andIdentifierUnit
.Working with the Set AllIdentifiers of the Language Reference.