Debian Codegraph @

help/info/ispresent.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 Baji, Laszlo
10 Balasko, Jeno
11 Csorba, Mate
12 Forstner, Matyas
13 Szabados, Kristof
14 -->
15 <html>
16 <head>
17 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
18 <meta http-equiv="Content-Language" content="en-us">
19 <title>ispresent</title>
20 </head>
21 <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
22 <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
23 <tr>
24 <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>
25 </tr>
26 </table>
27 <table border="0" align="right" cellpadding="0" cellspacing="0">
28 <tr>
29 <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
30 <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
31 <td><a alt="previous" href="ischosen.html"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
32 <td><a alt="next" href="isvalue.html"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
33 </tr>
34 </table>
35 <p><br clear="all">
36 </p>
37 <hr>
38 <h1>ispresent</h1>
39 <hr align="left" width="75%">
40 <p>This function returns the value <b><font face="Courier New">true</font></b> if and only if the value of the referenced field is present in the actual instance of the referenced data object.
41 <hr align="left" width="50%">
42 <p>Related keyword:</p>
43 <ul>
44 <li><b><font face="Courier New" size="4" color="#003258"> <a href="boolean.html">boolean</a></font></b></li>
45 <li><b><a href="true.html"><font face="Courier New" size="4" color="#003258"> true</font></a></b></li>
46 <li><b><font face="Courier New" size="4" color="#003258"><a href="false.html"> false</a></font></b></li>
47 <li><b><font face="Courier New" size="4" color="#003258"> <a href="optional.html">optional</a></font></b></li>
48 </ul>
49 <hr align="left" width="50%">
50 <div align="center">
51 <center>
52 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
53 <tr>
54 <td width="100%">
55 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>ispresent</b></font> <font face="Courier New" color="#003258" size="5"><b> (</b></font><i>any_type value</i><font
56 face="Courier New" color="#003258" size="5"><b>)return boolean</b></font></h3>
57 </td>
58 </tr>
59 </table>
60 </center>
61 </div>
62 <ul>
63 <li>
64 <p><i>any_type value</i> shall be a reference to a field within a data object that is defined as being <b><font face="Courier New">optional</font></b>.</p>
65 </li>
66 </ul>
67 <hr align="left" width="25%">
68 <p>Example 1:</p>
69 <p><font face="Courier New">type record&nbsp; MyRecordType {&nbsp;<br>
70 &nbsp;&nbsp;&nbsp;boolean field1 optional,<br>
71 &nbsp;&nbsp;&nbsp;integer field2<br>
72 }<br>
73 ...</font></p>
74 <p><font face="Courier New">var MyRecordType v_MyRecordType;<br>
75 ...</font></p>
76 <p><font face="Courier New">MyPort.receive(MyRecordType: ?) -&gt; value v_MyRecordType<br>
77 &nbsp; {<br>
78 &nbsp; if (ispresent(v_MyRecordType.field1))<br>
79 &nbsp;&nbsp;&nbsp; {...}<br>
80 ...</font></p>
81 <p>The record <font face="Courier New">MyRecordType</font> with an optional field has been received and stored in a variable. Then the presence of <font face="Courier New">field1</font> is
82 checked. Decisions can be made on the result of the <b><font face="Courier New">ispresent</font></b> function.</p>
83 <hr align="left" width="25%">
84 </body>
85 </html>