Fix example (See bug #13517)
[scilab.git] / scilab / modules / core / help / ja_JP / variables / isdef.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2008 - INRIA
5  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11  *
12  -->
13 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="isdef" xml:lang="ja">
14     <refnamediv>
15         <refname>isdef</refname>
16         <refpurpose>変数の存在を確認</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>呼び出し手順</title>
20         <synopsis>ve = isdef(name [,where])</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>引数</title>
24         <variablelist>
25             <varlistentry>
26                 <term>ve</term>
27                 <listitem>
28                     <para>
29                         論理値を有する <varname>name</varname>と同じ大きさの行列
30                     </para>
31                 </listitem>
32             </varlistentry>
33             <varlistentry>
34                 <term>name</term>
35                 <listitem>
36                     <para>文字列の行列</para>
37                 </listitem>
38             </varlistentry>
39             <varlistentry>
40                 <term>where</term>
41                 <listitem>
42                     <para>
43                         文字列, <literal>'l'</literal> (<literal>"local"</literal>の場合),
44                         <literal>'n'</literal> (<literal>"nolocal"</literal>の場合) or
45                         <literal>'a'</literal> (<literal>"all"</literal>の場合)を指定できます. 
46                         デフォルト値は <literal>'a'</literal>です.
47                     </para>
48                 </listitem>
49             </varlistentry>
50         </variablelist>
51     </refsection>
52     <refsection>
53         <title>説明</title>
54         <para>
55             <code>isdef(name)</code>は,
56             <varname>name</varname> という名前の変数が存在する場合に
57             <constant>%T</constant>,それ以外の場合に <constant>%F</constant>を返します.
58         </para>
59         <para>
60             <caution>
61                 注意: <function>isdef</function> を使用する関数
62                 は環境に依存した結果を返す可能性があります!
63             </caution>
64         </para>
65         <para>
66             <code>isdef(name, 'l')</code> は,
67             <varname>name</varname> という名前の変数がカレントの関数のローカル環境に
68             存在する場合に<constant>%T</constant>, 
69             それ以外の場合に <constant>%F</constant> を返します.
70         </para>
71         <para>
72             <code>isdef(name, 'n')</code>  は,
73             <varname>name</varname> という名前の変数が
74             (グローバルレベルを含む)呼び出した側の環境に
75             存在する場合に<constant>%T</constant>, 
76             それ以外の場合に <constant>%F</constant>を返します.
77         </para>
78         <note>
79             注意: <varname>where</varname>オプション
80             の最初の1文字のみが処理されます.
81         </note>
82     </refsection>
83     <refsection>
84         <title>例</title>
85         <programlisting role="example"><![CDATA[
86 A = 1; B = 2; C = 3; D = 4;
87 isdef(['A', 'B'; 'C', 'D'])
88 clear A B C D;
89 isdef(['A', 'B'; 'C', 'D'])
90 function level1()
91   function level2()
92     disp(isdef(["a", "b"], "a"));
93     disp(isdef(["a", "b"], "l"));
94     disp(isdef(["a", "b"], "n"));
95   endfunction
96   level2()
97 endfunction
98 function go()
99   a = 1;
100   level1()
101 endfunction
102 go()
103  ]]></programlisting>
104     </refsection>
105     <refsection role="see also">
106         <title>参照</title>
107         <simplelist type="inline">
108             <member>
109                 <link linkend="exists">exists</link>
110             </member>
111             <member>
112                 <link linkend="isglobal">isglobal</link>
113             </member>
114             <member>
115                 <link linkend="whereis">whereis</link>
116             </member>
117             <member>
118                 <link linkend="type">type</link>
119             </member>
120             <member>
121                 <link linkend="typeof">typeof</link>
122             </member>
123             <member>
124                 <link linkend="clear">clear</link>
125             </member>
126         </simplelist>
127     </refsection>
128 </refentry>