bug 7282, bug 7391 add links in help files
[scilab.git] / scilab / modules / string / help / en_US / evstr.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry version="5.0-subset Scilab" xml:id="evstr" xml:lang="en"
3           xmlns="http://docbook.org/ns/docbook"
4           xmlns:xlink="http://www.w3.org/1999/xlink"
5           xmlns:svg="http://www.w3.org/2000/svg"
6           xmlns:ns5="http://www.w3.org/1999/xhtml"
7           xmlns:mml="http://www.w3.org/1998/Math/MathML"
8           xmlns:db="http://docbook.org/ns/docbook">
9   <info>
10     <pubdate>$LastChangedDate$</pubdate>
11   </info>
12
13   <refnamediv>
14     <refname>evstr</refname>
15
16     <refpurpose>evaluation of expressions</refpurpose>
17   </refnamediv>
18
19   <refsynopsisdiv>
20     <title>Calling Sequence</title>
21
22     <synopsis>H=evstr(Z)
23 [H,ierr]=evstr(Z)</synopsis>
24   </refsynopsisdiv>
25
26   <refsection>
27     <title>Parameters</title>
28
29     <variablelist>
30       <varlistentry>
31         <term>Z</term>
32
33         <listitem>
34           <para>matrix of character strings <literal>M</literal> or
35           <literal>list(M,Subexp)</literal></para>
36
37           <variablelist>
38             <varlistentry>
39               <term>M</term>
40
41               <listitem>
42                 <para>matrix of character strings</para>
43               </listitem>
44             </varlistentry>
45
46             <varlistentry>
47               <term>Subexp</term>
48
49               <listitem>
50                 <para>vector of character strings</para>
51               </listitem>
52             </varlistentry>
53           </variablelist>
54         </listitem>
55       </varlistentry>
56
57       <varlistentry>
58         <term>H</term>
59
60         <listitem>
61           <para>matrix</para>
62         </listitem>
63       </varlistentry>
64
65       <varlistentry>
66         <term>ierr</term>
67
68         <listitem>
69           <para>integer, error indicator</para>
70         </listitem>
71       </varlistentry>
72     </variablelist>
73   </refsection>
74
75   <refsection>
76     <title>Description</title>
77
78     <para>Returns the result of the evaluation of the matrix of character
79     strings <literal>M</literal>. Each element of the matrix must define a
80     valid Scilab expression.</para>
81
82     <para>If the evaluation of <literal>M</literal> expression leads to an
83     error, the single return value version, <literal>H = evstr(M)</literal>,
84     raises the error as usual. The two return values version,
85     <literal>[H,ierr] = evstr(M)</literal>, on the other hand, produces no
86     error, but returns the error number in <literal>ierr</literal>.</para>
87
88     <para>If <literal>Z</literal> is a list, <literal>Subexp</literal> is a
89     vector of character strings, that defines sub_expressions which are
90     evaluated before evaluating <literal>M</literal>. These sub_expressions
91     must be referred to as <literal>%(k)</literal> in <literal>M</literal>,
92     where <literal>k</literal> is the sub-expression's index in
93     <literal>Subexp</literal>.</para>
94
95     <para>evstr('a = 1') is not valid (use <literal>execstr</literal>
96     instead).</para>
97
98     <para>Nan, NaN will be interpreted as %nan.</para>
99
100     <para>Inf will be interpreted as %inf.</para>
101   </refsection>
102
103   <refsection>
104     <title>Examples</title>
105
106     <programlisting role="example">a = 1; b = 2; Z = ['a', 'b'] ; evstr(Z) 
107 a = 1; b = 2; Z = list(['%(1)','%(1)-%(2)'],['a+1','b+1']);
108 evstr(Z)
109
110 evstr('NaN'), evstr('Inf')</programlisting>
111   </refsection>
112
113   <refsection>
114     <title>See Also</title>
115
116     <simplelist type="inline">
117       <member><link linkend="execstr">execstr</link></member>
118       <member><link linkend="evstr">evstr</link></member>
119       <member><link linkend="execstr">execstr</link></member>
120     </simplelist>
121   </refsection>
122 </refentry>