~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/core/help/en_US/keywords/global.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
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">
3
 
  <refnamediv>
4
 
    <refname>global</refname>
5
 
    <refpurpose> Define global variable</refpurpose>
6
 
  </refnamediv>
7
 
  <refsynopsisdiv>
8
 
    <title>Calling Sequence</title>
9
 
    <synopsis>global('nam1',...,'namn')
10
 
      global nam1 ... namn
11
 
    </synopsis>
12
 
  </refsynopsisdiv>
13
 
  <refsection>
14
 
    <title>Arguments</title>
15
 
    <variablelist>
16
 
      <varlistentry>
17
 
        <term>nam1,..., namn</term>
18
 
        <listitem>
19
 
          <para>valid variable names</para>
20
 
        </listitem>
21
 
      </varlistentry>
22
 
    </variablelist>
23
 
  </refsection>
24
 
  <refsection>
25
 
    <title>Description</title>
26
 
    <para>
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>.
33
 
    </para>
34
 
    <para>
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.
37
 
    </para>
38
 
  </refsection>
39
 
  <refsection>
40
 
    <title>Examples</title>
41
 
    <programlisting role="example"><![CDATA[ 
 
3
    <refnamediv>
 
4
        <refname>global</refname>
 
5
        <refpurpose> Define global variable</refpurpose>
 
6
    </refnamediv>
 
7
    <refsynopsisdiv>
 
8
        <title>Calling Sequence</title>
 
9
        <synopsis>global('nam1',...,'namn')
 
10
            global nam1 ... namn
 
11
        </synopsis>
 
12
    </refsynopsisdiv>
 
13
    <refsection>
 
14
        <title>Arguments</title>
 
15
        <variablelist>
 
16
            <varlistentry>
 
17
                <term>nam1,..., namn</term>
 
18
                <listitem>
 
19
                    <para>valid variable names</para>
 
20
                </listitem>
 
21
            </varlistentry>
 
22
        </variablelist>
 
23
    </refsection>
 
24
    <refsection>
 
25
        <title>Description</title>
 
26
        <para>
 
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>.
 
33
        </para>
 
34
        <para>
 
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.
 
37
        </para>
 
38
    </refsection>
 
39
    <refsection>
 
40
        <title>Examples</title>
 
41
        <programlisting role="example"><![CDATA[ 
42
42
//first: calling environnment and a function share a variable
43
43
global a
44
44
a=1
53
53
letsgo()
54
54
letsgo1()
55
55
 ]]></programlisting>
56
 
  </refsection>
57
 
  <refsection role="see also">
58
 
    <title>See Also</title>
59
 
    <simplelist type="inline">
60
 
      <member>
61
 
        <link linkend="who">who</link>
62
 
      </member>
63
 
      <member>
64
 
        <link linkend="isglobal">isglobal</link>
65
 
      </member>
66
 
      <member>
67
 
        <link linkend="clearglobal">clearglobal</link>
68
 
      </member>
69
 
      <member>
70
 
        <link linkend="gstacksize">gstacksize</link>
71
 
      </member>
72
 
      <member>
73
 
        <link linkend="resume">resume</link>
74
 
      </member>
75
 
    </simplelist>
76
 
  </refsection>
 
56
    </refsection>
 
57
    <refsection role="see also">
 
58
        <title>See Also</title>
 
59
        <simplelist type="inline">
 
60
            <member>
 
61
                <link linkend="who">who</link>
 
62
            </member>
 
63
            <member>
 
64
                <link linkend="isglobal">isglobal</link>
 
65
            </member>
 
66
            <member>
 
67
                <link linkend="clearglobal">clearglobal</link>
 
68
            </member>
 
69
            <member>
 
70
                <link linkend="gstacksize">gstacksize</link>
 
71
            </member>
 
72
            <member>
 
73
                <link linkend="resume">resume</link>
 
74
            </member>
 
75
        </simplelist>
 
76
    </refsection>
77
77
</refentry>