Debian Codegraph @

help/info/int2enum.html

raw symbols SCIP
1 <!--
2 Copyright (c) 2000-2021 Ericsson Telecom AB
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Eclipse Public License v2.0
5 which accompanies this distribution, and is available at
6 https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7
8 Contributors:
9 Balasko, Jeno
10 -->
11 <html>
12 <head>
13 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
14 <meta http-equiv="Content-Language" content="en-us">
15 <title>int2enum</title>
16 </head>
17 <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
18 <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
19 <tr>
20 <td width=105 height=40><a href="https://projects.eclipse.org/projects/tools.titan"><img src="../images/titan_transparent.gif" border=0 width=105 height=40 align="left" alt="Titan"></a></td>
21 </tr>
22 </table>
23 <table border="0" align="right" cellpadding="0" cellspacing="0">
24 <tr>
25 <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
26 <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
27 <td><a alt="previous" href="int2char.html"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
28 <td><a alt="next" href="int2float.html"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
29 </tr>
30 </table>
31 <p><br clear="all">
32 </p>
33 <hr>
34 <h1>int2enum</h1>
35 <hr align="left" width="75%"/>
36 <p>This function converts an <b><font face="Courier New">integer</font></b> value into an <b><font face="Courier New">enumerated</font></b> value of a given enumerated type.
37 <hr align="left" width="50%"/>
38 <p>Related keyword:</p>
39 <ul>
40 <li><b><font face="Courier New" size="4" color="#003258"> <a href="integer.html">integer</a></font></b></li>
41 <li><b><a href="enumerated.html"><font face="Courier New" size="4" color="#003258">enumerated</font></a></b></li>
42 </ul>
43 <hr align="left" width="50%">
44 <div align="center">
45 <center>
46 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
47 <tr>
48 <td width="100%">
49 <h3 align="center">
50 <font face="Courier New" color="#003258" size="5"><b>int2enum ( in integer </b></font>
51 <i>inpar</i>
52 <font face="Courier New" color="#003258" size="5"><b> ,out</b></font>
53 Enumerated_type
54 <i>outpar</i>
55 <font face="Courier New" color="#003258" size="5"><b> )</b></font>
56 </h3>
57
58 </td>
59 </tr>
60 </table>
61 </center>
62 </div>
63 <ul>
64 <li>
65 <p>The integer value shall be
66 provided as in parameter "inpar" and the result of the conversion shall be stored in an out parameter "outpar".</p>
67 </li>
68 <li>
69 <p>The type of the out parameter determines the type into which the in parameter is converted.</p>
70 </li>
71 </ul>
72 <hr align="left" width="25%"/>
73
74 <p>Example:</p>
75 <p>
76 <font face="Courier New">
77 type enumerated MyFirstEnumType { <br/>
78 &nbsp;&nbsp;&nbsp;Monday, Tuesday, Wednesday, Thursday, Friday <br/>
79 };<br/> <br/>
80 type enumerated MySecondEnumType {<br/>
81 &nbsp;&nbsp;&nbsp;Saturday(-3), Sunday (0), Monday<br/>
82 };<br/><br/>
83 //within a dynamic language element:<br/>
84 var MyFirstEnumType firstEnum := Tuesday;<br/>
85 var MySecondEnumType secondEnum := Sunday;<br/><br/>
86 int2enum(0, firstEnum) // firstEnum == Monday<br/>
87 int2enum(1, secondEnum) // secondEnum == Monday<br/>
88 </font>
89 </p>
90
91 <hr align="left" width="25%"/>
92 </body>
93 </html>