gschur() was declared obsolete in Scilab 4, now removed
[scilab.git] / scilab / modules / functions / help / ja_JP / execstr.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5  * Copyright (C) XXXX-2008 - INRIA
6  *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17
18 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="execstr">
19     
20     <refnamediv>
21         
22         <refname>execstr</refname>
23         
24         <refpurpose>文字列中のScilabコードを実行</refpurpose>
25         
26     </refnamediv>
27     
28     <refsynopsisdiv>
29         
30         <title>呼び出し手順</title>
31         
32         <synopsis>execstr(instr)
33             
34             ierr = execstr(instr, 'errcatch' [,msg])
35             
36         </synopsis>
37         
38     </refsynopsisdiv>
39     
40     <refsection>
41         
42         <title>引数</title>
43         
44         <variablelist>
45             
46             <varlistentry>
47                 
48                 <term>instr</term>
49                 
50                 <listitem>
51                     
52                     <para>文字列のベクトル, 実行するScilab命令.</para>
53                     
54                 </listitem>
55                 
56             </varlistentry>
57             
58             <varlistentry>
59                 
60                 <term>ierr</term>
61                 
62                 <listitem>
63                     
64                     <para>整数, 0 ばたはエラー番号.</para>
65                     
66                 </listitem>
67                 
68             </varlistentry>
69             
70             <varlistentry>
71                 
72                 <term>msg</term>
73                 
74                 <listitem>
75                     
76                     <para>
77                         
78                         値<literal>'m'</literal> または<literal>'n'</literal>
79                         
80                         を有する文字列.
81                         
82                         デフォルト値は<literal>'n'</literal>.
83                         
84                     </para>
85                     
86                 </listitem>
87                 
88             </varlistentry>
89             
90         </variablelist>
91         
92     </refsection>
93     
94     <refsection>
95         
96         <title>説明</title>
97         
98         <para>
99             
100             引数<varname>instr</varname>で指定したScilab命令を実行します.
101             
102         </para>
103         
104         <note>
105             
106             <varname>instr</varname>の中では継続記号 (..) を使用する
107             
108             べきではないことに注意してください.
109             
110         </note>
111         
112         <para>
113             
114             <literal>'errcatch'</literal>フラグが指定されない場合,
115             
116             エラー処理は通常と同様に行われます.
117             
118         </para>
119         
120         <para>
121             
122             <literal>'errcatch'</literal>フラグが指定された場合,
123             
124             <varname>instr</varname>で定義された命令を実行す際に
125             
126             発生したエラーはエラーメッセージを発生せず,
127             
128             <varname>instr</varname> 命令の実行を
129             
130             (エラーが発生した場所で)破棄し,
131             
132             エラー番号に等しい<varname>ierr</varname>を返して
133             
134             復帰します.
135             
136             この場合,エラーメッセージの出力は
137             
138             <varname>msg</varname>オプションにより次のように
139             
140             制御されます:
141             
142         </para>
143         
144         <variablelist>
145             
146             <varlistentry>
147                 
148                 <term>"m"</term>
149                 
150                 <listitem>
151                     
152                     <para>エラーメッセージは表示され,記録されます.</para>
153                     
154                 </listitem>
155                 
156             </varlistentry>
157             
158             <varlistentry>
159                 
160                 <term>"n"</term>
161                 
162                 <listitem>
163                     
164                     <para>
165                         
166                         エラーメッセージは表示されませんが,
167                         
168                         記録されます ( <link linkend="lasterror">lasterror</link>参照).
169                         
170                         これがデフォルトです.
171                         
172                     </para>
173                     
174                 </listitem>
175                 
176             </varlistentry>
177             
178         </variablelist>
179         
180         <para>
181             
182             <code>ierr = execstr(instr, 'errcatch')</code> は構文エラーも
183             
184             処理することができます.
185             
186             この特徴は,ユーザへの問い合わせにより得られた命令を
187             
188             評価する際に有用です.
189             
190         </para>
191         
192     </refsection>
193     
194     <refsection>
195         
196         <title>例</title>
197         
198         <programlisting role="example"><![CDATA[
199 execstr('a=1') // sets a=1.
200 execstr('1+1') // does nothing (while evstr('1+1') returns 2)
201 execstr(['if %t then';
202          '  a=1';
203          '  b=a+1';
204          'else'
205          ' b=0'
206          'end'])
207 execstr('a=zzzzzzz','errcatch')
208 execstr('a=zzzzzzz','errcatch','m')
209 //syntax errors
210 execstr('a=1?02','errcatch')
211 lasterror(%t)
212 execstr('a=[1 2 3)','errcatch')
213 lasterror(%t)
214 // variable1 does not exist
215 if execstr('variable1;','errcatch')<>0 then
216    disp("Trigger an error");
217 else
218    disp("execstr is happy");
219 end
220 // variable2 exists ... no error is triggered by execstr
221 variable2=[2,3];
222 if execstr('variable2;','errcatch')<>0 then
223    disp("Trigger an error");
224 else
225    disp("execstr is happy");
226 end
227  ]]></programlisting>
228         
229     </refsection>
230     
231     <refsection role="see also">
232         
233         <title>参照</title>
234         
235         <simplelist type="inline">
236             
237             <member>
238                 
239                 <link linkend="evstr">evstr</link>
240                 
241             </member>
242             
243             <member>
244                 
245                 <link linkend="lasterror">lasterror</link>
246                 
247             </member>
248             
249             <member>
250                 
251                 <link linkend="error">error</link>
252                 
253             </member>
254             
255             <member>
256                 
257                 <link linkend="try">try</link>
258                 
259             </member>
260             
261         </simplelist>
262         
263     </refsection>
264     
265 </refentry>
266