1
1
<?xml version="1.0" encoding="UTF-8"?>
2
2
<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" version="5.0-subset Scilab" xml:lang="en" xml:id="global">
4
<refname>global</refname>
5
<refpurpose> Define global variable</refpurpose>
8
<title>Calling Sequence</title>
9
<synopsis>global('nam1',...,'namn')
14
<title>Arguments</title>
17
<term>nam1,..., namn</term>
19
<para>valid variable names</para>
25
<title>Description</title>
27
Ordinarily, each Scilab function, has its
28
own local variables and can "read" all variables created in the base
29
workspace or by the calling functions. The <literal>global</literal> keyword allow to make
30
variables read/write across functions. Any assignment to that variable,
31
in any function, is available to all the other functions declaring
32
it <literal>global</literal>.
35
If the global variable does not exist the first time you issue
36
the <literal>global</literal> statement, it will be initialized to the empty matrix.
40
<title>Examples</title>
41
<programlisting role="example"><![CDATA[
4
<refname>global</refname>
5
<refpurpose> Define global variable</refpurpose>
8
<title>Calling Sequence</title>
9
<synopsis>global('nam1',...,'namn')
14
<title>Arguments</title>
17
<term>nam1,..., namn</term>
19
<para>valid variable names</para>
25
<title>Description</title>
27
Ordinarily, each Scilab function, has its
28
own local variables and can "read" all variables created in the base
29
workspace or by the calling functions. The <literal>global</literal> keyword allow to make
30
variables read/write across functions. Any assignment to that variable,
31
in any function, is available to all the other functions declaring
32
it <literal>global</literal>.
35
If the global variable does not exist the first time you issue
36
the <literal>global</literal> statement, it will be initialized to the empty matrix.
40
<title>Examples</title>
41
<programlisting role="example"><![CDATA[
42
42
//first: calling environnment and a function share a variable
55
55
]]></programlisting>
57
<refsection role="see also">
58
<title>See Also</title>
59
<simplelist type="inline">
61
<link linkend="who">who</link>
64
<link linkend="isglobal">isglobal</link>
67
<link linkend="clearglobal">clearglobal</link>
70
<link linkend="gstacksize">gstacksize</link>
73
<link linkend="resume">resume</link>
57
<refsection role="see also">
58
<title>See Also</title>
59
<simplelist type="inline">
61
<link linkend="who">who</link>
64
<link linkend="isglobal">isglobal</link>
67
<link linkend="clearglobal">clearglobal</link>
70
<link linkend="gstacksize">gstacksize</link>
73
<link linkend="resume">resume</link>