Debian Codegraph @

help/info/encvalue.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 Baranyi, Botond
12 Szabados, Kristof
13 Zalanyi, Balazs Andor
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>encvalue</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 href="encode_base64.html" alt="previous"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
32 <td><a href="encvalue_unichar.html" alt="next"><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>encvalue</h1>
39 <hr align="left" width="75%">
40 <p>This built-in function is used to encode a value argument into a bitstring.
41 <ul>
42 <li>The function returns bitstring.</li>
43 <li>If template is used as the first parameter in <font face="Courier New" size="4">encvalue()</font>, it has to be resolved to a specific value.</li>
44 <li>Type of the first argument has to have an <i>encoding method</i> explicitly set with its attributes.</li>
45 <li>The second argument is currently ignored.</li>
46 <li>The third argument selects the encoding method to use, if the type has multiple encoding methods set.</li>
47 </ul>
48 <p>Related keywords:</p>
49 <ul>
50 <li><a href="send.html"><b><font face="Courier New" color="#003258" size="4">send</font></b></a></li>
51 <li><a href="encode.html"><b><font face="Courier New" color="#003258" size="4">encode</font></b></a></li>
52 <li><a href="encvalue_unichar.html"><b><font face="Courier New" color="#003258" size="4">encvalue_unichar</font></b></a></li>
53 <li><a href="decvalue.html"><b><font face="Courier New" color="#003258" size="4">decvalue</font></b></a></li>
54 <li><a href="decvalue_unichar.html"><b><font face="Courier New" color="#003258" size="4">decvalue_unichar</font></b></a></li>
55 </ul>
56 <hr align="left" width="50%">
57 <div align="center">
58 <center>
59 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
60 <tr>
61 <td width="100%">
62 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>encvalue(</b></font> <i>value_part [, encoding_info
63 [, dynamic_encoding]]</i> <font face="Courier New" color="#003258" size="5"><b>) return bitstring;</b></font></h3>
64 </td>
65 </tr>
66 </table>
67 </center>
68 </div>
69 <hr align="left" width="50%">
70 <p>Example 1:
71 <p><font face="Courier New">type float MyFloat with { encode "RAW" }</font>
72 <p><font face="Courier New">var MyFloat f := 1.1;</font>
73 <p><font face="Courier New">var bitstring bs := encvalue(f);</font>
74 <p>This will store the "RAW" encoded form of the float value <i>1.1</i> into the bitstring variable <i>bs</i>.</p>
75 <hr align="left" width="25%">
76 <p>Example 2:
77 <p><font face="Courier New">type record MyRecord {<br>
78 &nbsp;&nbsp;&nbsp;integer num,<br>
79 &nbsp;&nbsp;&nbsp;charstring str<br>
80 }<br>
81 with {<br>
82 &nbsp;&nbsp;&nbsp;encode "XML";<br>
83 &nbsp;&nbsp;&nbsp;encode "JSON";<br>
84 }</font>
85 <p><font face="Courier New">var MyRecord r := { num := 3, str := "abc" };</font>
86 <p><font face="Courier New">var bitstring bs := encvalue(r, "", "JSON");</font>
87 <p>This will store the "JSON" encoded form of the record value <i>{ num := 3, str := "abc" }</i> into the bitstring variable <i>bs</i>.</p>
88 <hr align="left" width="25%">
89 <hr align="left" width="25%">
90 <p><a HREF="BNF.html#encvalue">BNF definition</a> of <font face="Courier New">encvalue</font></p>
91 </body>
92 </html>