* Bug 15308 fixed: evstr(['1;2' '3;4']) was not accepted, unlike ['1 2';'3 4']
[scilab.git] / scilab / modules / string / help / pt_BR / evstr.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
3     xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
4     xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
5     xmlns:scilab="http://www.scilab.org" xml:id="evstr" xml:lang="pt">
6     <refnamediv>
7         <refname>evstr</refname>
8         <refpurpose>avaliação de expressões</refpurpose>
9     </refnamediv>
10     <refsynopsisdiv>
11         <title>Seqüência de Chamamento</title>
12         <synopsis>
13             H = evstr(M)
14             H = evstr(list(M, subExpr))
15             [H, ierr] = evstr(..)
16         </synopsis>
17     </refsynopsisdiv>
18     <refsection>
19         <title>Parâmetros</title>
20         <variablelist>
21           <varlistentry>
22             <term>M</term>
23             <listitem>
24               <para>matriz de strings</para>
25             </listitem>
26           </varlistentry>
27           <varlistentry>
28             <term>subExpr</term>
29             <listitem>
30               <para>vetor de strings</para>
31             </listitem>
32           </varlistentry>
33           <varlistentry>
34             <term>H</term>
35             <listitem>
36               <para>matriz</para>
37             </listitem>
38           </varlistentry>
39           <varlistentry>
40             <term>ierr</term>
41             <listitem>
42               <para>inteiro, indicador de erro</para>
43             </listitem>
44           </varlistentry>
45         </variablelist>
46     </refsection>
47     <refsection>
48         <title>Descrição</title>
49         <para>
50             Retorna o resultado da avaliação da matriz de strings <literal>M</literal>.
51             Cada elemento da matriz deve definir uma expressão Scilab válida.
52         </para>
53         <para>
54             Se a avaliação de <literal>M</literal> levar a um erro, a versão de
55             valor de único retorno, <literal>H=evstr(M)</literal>, levanta erro de
56             modo usual. A versão de dois valores de retorno,
57             <literal>[H,ierr]=evstr(M)</literal> , por outro lado, não produz erro,
58             mas retorna o número de erro em <literal>ierr</literal>.
59         </para>
60         <para>
61             Se uma lista for fornecida, <literal>subExpr</literal> é um
62             vetor de strings, que define subexpressões que são avaliadas antes da
63             avaliação de <literal>M</literal>. Estas subexpressões devem ser referidas
64             como <literal>%(k)</literal> em <literal>M</literal>, onde
65             <literal>k</literal> é o índice da subexpressão em
66             <literal>Subexp</literal>.
67         </para>
68         <warning>
69             <itemizedlist>
70                 <listitem>
71                     <para>
72                     Assignments like <literal>"a = 1"</literal> are not accepted as expressions,
73                     neither in <varname>M</varname> nor in <varname>subExpr</varname>.
74                     <function>execstr</function> must be used instead to evaluate such expressions.
75                     </para>
76                 </listitem>
77                 <listitem>
78                     <para>
79                     Continuation marks <literal>".."</literal> are forbidden in expressions
80                     in <varname>M</varname> as well as in <varname>subExpr</varname>.
81                     </para>
82                 </listitem>
83             </itemizedlist>
84         </warning>
85         <note>Special aliases:
86             <itemizedlist>
87                 <listitem>
88                         <literal>"Nan"</literal> and <literal>"NaN"</literal> are parsed as
89                         <constant>%nan</constant>.
90                 </listitem>
91                 <listitem>
92                         <literal>"Inf"</literal> and <literal>"INF"</literal> are parsed as
93                         <constant>%inf</constant>.
94                 </listitem>
95             </itemizedlist>
96         </note>
97     </refsection>
98     <refsection>
99         <title>Exemplos</title>
100         <programlisting role="example"><![CDATA[
101 a = 1; b = 2; Z = ['a','b'] ;
102 evstr(Z)
103
104 a = 1; b = 2; Z = list(['%(1)','%(1)-%(2)'],['a+1','b+1']);
105 evstr(Z)
106
107 evstr('NaN'), evstr('Inf')
108
109 //The two return values version
110 [H, ierr] = evstr(Z) // no error
111 Z = ['a', 'b', 'c'] ;// the variable c is undefined
112 [H, ierr] = evstr(Z) // error 4: Undefined variable: c
113 ]]>     </programlisting>
114     </refsection>
115     <refsection>
116         <title>Ver Também</title>
117         <simplelist type="inline">
118             <member>
119                 <link linkend="execstr">execstr</link>
120             </member>
121             <member>
122                 <link linkend="sci2exp">sci2exp</link>
123             </member>
124             <member>
125                 <link linkend="strtod">strtod</link>
126             </member>
127             <member>
128                 <link linkend="brackets">concatenation</link>
129             </member>
130         </simplelist>
131     </refsection>
132     <refsection role="history">
133         <title>Histórico</title>
134         <revhistory>
135             <revision>
136                 <revnumber>5.3.0</revnumber>
137                 <revdescription>
138                 <literal>"Nan"</literal> and <literal>"NaN"</literal> are now parsed as <literal>%nan</literal>.
139                 <literal>"Inf"</literal> and <literal>"INF"</literal> are now parsed as <literal>%inf</literal>.
140                 </revdescription>
141             </revision>
142             <revision>
143                 <revnumber>6.0.1</revnumber>
144                 <revdescription>
145                   Simple comments are now supported in almost all possible input expressions,
146                   whatever is the shape of <literal>M</literal>.
147                 </revdescription>
148             </revision>
149         </revhistory>
150     </refsection>
151 </refentry>