# int2enum

This function converts an integer value into an enumerated value of a given enumerated type.

Related keyword:

- integer
- enumerated

### int2enum ( in integer inpar ,out Enumerated_type outpar )

- The integer value shall be provided as in parameter "inpar" and the result of the conversion shall be stored in an out parameter "outpar".

- The type of the out parameter determines the type into which the in parameter is converted.

Example:

type enumerated MyFirstEnumType {
Monday, Tuesday, Wednesday, Thursday, Friday
};
type enumerated MySecondEnumType {
Saturday(-3), Sunday (0), Monday
};
//within a dynamic language element:
var MyFirstEnumType firstEnum := Tuesday;
var MySecondEnumType secondEnum := Sunday;
int2enum(0, firstEnum) // firstEnum == Monday
int2enum(1, secondEnum) // secondEnum == Monday