gschur() was declared obsolete in Scilab 4, now removed
[scilab.git] / scilab / modules / functions / help / ja_JP / exec.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <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="exec">
4     
5     <refnamediv>
6         
7         <refname>exec</refname>
8         
9         <refpurpose>スクリプトファイルを実行する</refpurpose>
10         
11     </refnamediv>
12     
13     <refsynopsisdiv>
14         
15         <title>呼び出し手順</title>
16         
17         <synopsis>exec(path [,mode])
18             
19             exec(fun [,mode])
20             
21             ierr = exec(path, 'errcatch' [,mode])
22             
23             ierr = exec(fun, 'errcatch' [,mode])
24             
25         </synopsis>
26         
27     </refsynopsisdiv>
28     
29     <refsection>
30         
31         <title>引数</title>
32         
33         <variablelist>
34             
35             <varlistentry>
36                 
37                 <term>path</term>
38                 
39                 <listitem>
40                     
41                     <para>文字列, スクリプトファイルへのパス</para>
42                     
43                 </listitem>
44                 
45             </varlistentry>
46             
47             <varlistentry>
48                 
49                 <term>mode</term>
50                 
51                 <listitem>
52                     
53                     <para>整数スカラー,実行モード (以下参照)</para>
54                     
55                 </listitem>
56                 
57             </varlistentry>
58             
59             <varlistentry>
60                 
61                 <term>fun</term>
62                 
63                 <listitem>
64                     
65                     <para>scilab 関数</para>
66                     
67                 </listitem>
68                 
69             </varlistentry>
70             
71             <varlistentry>
72                 
73                 <term>ierr</term>
74                 
75                 <listitem>
76                     
77                     <para>整数, 0 またはエラー番号</para>
78                     
79                 </listitem>
80                 
81             </varlistentry>
82             
83         </variablelist>
84         
85     </refsection>
86     
87     <refsection>
88         
89         <title>説明</title>
90         
91         <para>
92             
93             <code>exec(path [,mode])</code> は,
94             
95             <varname>path</varname>で指定したファイルの中のオプションの
96             
97             実行モード<varname>mode</varname> でScilab命令を逐次実行します.
98             
99         </para>
100         
101         <para>
102             
103             以下の <varname>mode</varname> を指定できます :
104             
105         </para>
106         
107         <variablelist>
108             
109             <varlistentry>
110                 
111                 <term>0</term>
112                 
113                 <listitem>
114                     
115                     <para>
116                         
117                         デフォルト値.
118                         
119                     </para>
120                     
121                 </listitem>
122                 
123             </varlistentry>
124             
125             <varlistentry>
126                 
127                 <term>-1</term>
128                 
129                 <listitem>
130                     
131                     <para>
132                         
133                         何も出力しない.
134                         
135                     </para>
136                     
137                 </listitem>
138                 
139             </varlistentry>
140             
141             <varlistentry>
142                 
143                 <term>1</term>
144                 
145                 <listitem>
146                     
147                     <para>
148                         
149                         各コマンド行を出力(エコーバック)する.
150                         
151                     </para>
152                     
153                 </listitem>
154                 
155             </varlistentry>
156             
157             <varlistentry>
158                 
159                 <term>2</term>
160                 
161                 <listitem>
162                     
163                     <para>
164                         
165                         プロンプト <literal>--&gt;</literal> を出力する.
166                         
167                     </para>
168                     
169                 </listitem>
170                 
171             </varlistentry>
172             
173             <varlistentry>
174                 
175                 <term>3</term>
176                 
177                 <listitem>
178                     
179                     <para>
180                         
181                         エコー + プロンプト.
182                         
183                     </para>
184                     
185                 </listitem>
186                 
187             </varlistentry>
188             
189             <varlistentry>
190                 
191                 <term>4</term>
192                 
193                 <listitem>
194                     
195                     <para>
196                         
197                         各プロンプト出力の前に停止します. キャレッジリターンを入力すると実行が再開します.
198                         
199                     </para>
200                     
201                 </listitem>
202                 
203             </varlistentry>
204             
205             <varlistentry>
206                 
207                 <term>7</term>
208                 
209                 <listitem>
210                     
211                     <para>
212                         
213                         停止 + プロンプト + エコー : デモを行う際に有用なモード.
214                         
215                     </para>
216                     
217                 </listitem>
218                 
219             </varlistentry>
220             
221         </variablelist>
222         
223         <para>
224             
225             <code>exec(fun [,mode])</code> は関数
226             
227             <varname>fun</varname> をスクリプトとして実行します:
228             
229             入出力の引数も特定の変数環境もありません.
230             
231             スクリプト評価のこの方法により,スクリプトをライブラリの
232             
233             関数として保存することが可能になります.
234             
235         </para>
236         
237         <para>
238             
239             実行時にエラーが発生し,
240             
241             <literal>'errcatch'</literal>フラグが指定されている場合,
242             
243             <function>exec</function>はエラーメッセージを出力せずに
244             
245             命令を実行を破棄し,エラー番号を<varname>ierr</varname>に
246             
247             代入して復帰します.
248             
249             <literal>'errcatch'</literal> フラグが存在しない場合,標準のエラー処理が
250             
251             機能します.
252             
253         </para>
254         
255     </refsection>
256     
257     <refsection>
258         
259         <title>注意</title>
260         
261         <para>
262             
263             <function>exec</function> ファイルは,
264             
265             インライン関数定義構文(関数の項参照)により関数を定義する際に使用されます
266             
267             (<link linkend="function">function</link>参照).
268             
269         </para>
270         
271         <para>
272             
273             <function>exec</function> はANSI/アスキー および UTF-8 エンコード
274             
275             されたファイルをサポートします.
276             
277         </para>
278         
279         <para>ファイル中の各行の長さは 4096 文字に制限されています.</para>
280         
281     </refsection>
282     
283     <refsection>
284         
285         <title>例</title>
286         
287         <programlisting role="example"><![CDATA[
288 // スクリプトファイルを作成
289 mputl('a=1;b=2',TMPDIR+'/myscript')
290 // スクリプトを実行
291 exec(TMPDIR+'/myscript')
292 whos -name "a "
293 // 関数を作成
294 deff('y=foo(x)','a=x+1;y=a^2')
295 clear a b
296 // 関数をコール
297 foo(1)
298 // a は関数 foo の環境に作成された変数
299 //    この変数は foo がリターンする時に破棄されます
300 whos -name "a "
301 x=1 // xを作成し,スクリプトfooによりアクセス可能とする.
302 exec(foo)
303 // カレントの環境にa と y が作成されました
304 whos -name "a "
305 whos -name "y "
306  ]]></programlisting>
307         
308     </refsection>
309     
310     <refsection role="see also">
311         
312         <title>参照</title>
313         
314         <simplelist type="inline">
315             
316             <member>
317                 
318                 <link linkend="execstr">execstr</link>
319                 
320             </member>
321             
322             <member>
323                 
324                 <link linkend="evstr">evstr</link>
325                 
326             </member>
327             
328             <member>
329                 
330                 <link linkend="mode">mode</link>
331                 
332             </member>
333             
334             <member>
335                 
336                 <link linkend="chdir">chdir</link>
337                 
338             </member>
339             
340             <member>
341                 
342                 <link linkend="pwd">pwd</link>
343                 
344             </member>
345             
346         </simplelist>
347         
348     </refsection>
349     
350 </refentry>
351