Debian Codegraph @

help/info/str2int.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 Kovacs, Ferenc
14 Szabados, Kristof
15 -->
16 <html>
17 <head>
18 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
19 <meta http-equiv="Content-Language" content="en-us">
20 <title>str2int</title>
21 </head>
22 <body bgcolor="#DAD3C5" vlink="#0094D2" link="#003258">
23 <table align="left" border="0" cellspacing="0" cellpadding="0" valign=top>
24 <tr>
25 <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>
26 </tr>
27 </table>
28 <table border="0" align="right" cellpadding="0" cellspacing="0">
29 <tr>
30 <td><a href="../titan_main.html" alt="contents"><img border="0" src="../images/ao.jpg" width="53" height="40"></a></td>
31 <td><a href="../titan_index.html" alt="index"><img border="0" src="../images/up.jpg" width="53" height="40"></a></td>
32 <td><a alt="previous" href="str2hex.html"><img border="0" src="../images/left.jpg" width="53" height="40"></a></td>
33 <td><a alt="next" href="str2oct.html"><img border="0" src="../images/right.jpg" width="53" height="40"></a></td>
34 </tr>
35 </table>
36 <p><br clear="all">
37 </p>
38 <hr>
39 <h1>str2int</h1>
40 <hr align="left" width="75%">
41 <p>This function converts a <b><font face="Courier New">charstring</font></b> representing an <b><font face="Courier New">integer</font></b> value to the equivalent <b><font face="Courier New">integer</font></b>.
42 If the string does not represent a valid integer value (e.g. it's an empty string, there're
43 some non-numerical/non-sign characters in the string etc.) the function gives a compile error
44 for string constants or a dynamic testcase error when the string cannot be evaluated at
45 compile time.
46 <hr align="left" width="50%">
47 <p>Related keyword:</p>
48 <ul>
49 <li><b><font face="Courier New" size="4" color="#003258"> <a href="integer.html">integer</a></font></b></li>
50 <li><b><a href="charstring.html"><font face="Courier New" size="4" color="#003258"> charstring</font></a></b></li>
51 </ul>
52 <hr align="left" width="50%">
53 <div align="center">
54 <center>
55 <table border="0" width="90%" bgcolor="#FFB599" cellpadding="4">
56 <tr>
57 <td width="100%">
58 <h3 align="center"><font face="Courier New" color="#003258" size="5"><b>str2int</b></font><font face="Courier New" color="#003258" size="5"><b>(</b></font><i>charstring value</i><font
59 face="Courier New" color="#003258" size="5"><b>) return integer</b></font></h3>
60 </td>
61 </tr>
62 </table>
63 </center>
64 </div>
65 <ul>
66 </ul>
67 <hr align="left" width="25%">
68 <p>Example 1:</p>
69 <p><font face="Courier New">const integer c_siffra := str2int("-66"); </font></p>
70 <p>The constant called c_siffra will have the integer value -66.
71 <p>Example 2:</p>
72 <p><font face="Courier New">const integer c_seffre := str2int("abc"); </font></p>
73 <p>Compile error.
74 <hr align="left" width="25%">
75 </body>
76 </html>