.ModelicaReference.Operators.'Integer()'

Information

Returns ordinal number of enumeration

Syntax

Integer(<expression of enumeration type>)

Description

Returns the ordinal number of the enumeration value E.enumvalue, to which the expression is evaluated, where Integer(E.e1) =1, Integer(E.en) =size(E), for an enumeration type E=enumeration(e1, ..., en).

Examples

type Size = enumeration(small, medium, large, xlarge);
Size tshirt = Size.large;
Integer tshirtValue = Integer(tshirt);  // = 3

Generated at 2019-12-15T02:38:26Z by OpenModelicaOpenModelica 1.16.0~dev-83-g5b8ff4c using GenerateDoc.mos