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

« back to all changes in this revision

Viewing changes to modules/functions/help/en_US/exec.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="exec">
3
 
  <refnamediv>
4
 
    <refname>exec</refname>
5
 
    <refpurpose> script file execution</refpurpose>
6
 
  </refnamediv>
7
 
  <refsynopsisdiv>
8
 
    <title>Calling Sequence</title>
9
 
    <synopsis>exec(path [,mode])
10
 
      exec(fun [,mode])
11
 
      ierr=exec(path,'errcatch' [,mode])
12
 
      ierr=exec(fun,'errcatch' [,mode])
13
 
    </synopsis>
14
 
  </refsynopsisdiv>
15
 
  <refsection>
16
 
    <title>Arguments</title>
17
 
    <variablelist>
18
 
      <varlistentry>
19
 
        <term>path</term>
20
 
        <listitem>
21
 
          <para>a string, the path of the script file</para>
22
 
        </listitem>
23
 
      </varlistentry>
24
 
      <varlistentry>
25
 
        <term>mode</term>
26
 
        <listitem>
27
 
          <para>an integer scalar, the execution mode (see below)</para>
28
 
        </listitem>
29
 
      </varlistentry>
30
 
      <varlistentry>
31
 
        <term>fun</term>
32
 
        <listitem>
33
 
          <para>a scilab function</para>
34
 
        </listitem>
35
 
      </varlistentry>
36
 
      <varlistentry>
37
 
        <term>ierr</term>
38
 
        <listitem>
39
 
          <para>integer, 0 or error number</para>
40
 
        </listitem>
41
 
      </varlistentry>
42
 
    </variablelist>
43
 
  </refsection>
44
 
  <refsection>
45
 
    <title>Description</title>
46
 
    <para>
47
 
      <literal>exec(path [,mode])</literal> executes sequentialy the scilab instructions
48
 
      contained in the file given by <literal>path</literal>  with an optional 
49
 
      execution mode <literal>mode</literal> .
50
 
    </para>
51
 
    <para>
52
 
      The different cases for <literal>mode</literal> are :
53
 
    </para>
54
 
    <para>
55
 
      0 
56
 
      : the default value
57
 
    </para>
58
 
    <para>
59
 
      -1 
60
 
      : nothing is printed
61
 
    </para>
62
 
    <para>
63
 
      1 
64
 
      : echo of each command line
65
 
    </para>
66
 
    <para>
67
 
      2 
68
 
      : prompt <literal>--&gt;</literal> is printed
69
 
    </para>
70
 
    <para>
71
 
      3 
72
 
      : echoes + prompts
73
 
    </para>
74
 
    <para>
75
 
      4 
76
 
      : stops before each prompt. Execution resumes after a carriage return.
77
 
    </para>
78
 
    <para>
79
 
      7 
80
 
      : stops + prompts + echoes : useful mode for demos.
81
 
    </para>
82
 
    <para>
83
 
      <literal>exec(fun [,mode])</literal> executes function  <literal>fun</literal> as a script: no
84
 
      input nor output argument nor specific variable environment. This form
85
 
      is more efficient, because script code may be pre-compiled (see comp). This method for script evaluation allows to store scripts as
86
 
      function in libraries.
87
 
    </para>
88
 
    <para>
89
 
      If an error is encountered while executing, if 'errcatch' flag is
90
 
      present <literal>exec</literal> issues no error message, aborts execution of the
91
 
      instructions and resumes with <literal>ierr</literal> equal to the error
92
 
      number. If 'errcatch' flag is not present, standard error handling
93
 
      works.
94
 
    </para>
95
 
  </refsection>
96
 
  <refsection>
97
 
    <title>Remarks</title>
98
 
    <para>
99
 
      <literal>exec</literal> files may now be used to define functions using the inline function definition syntax (see function).
100
 
    </para>
101
 
    <para>
102
 
      <literal>exec</literal> supports files encoded as ANSI/ASCII and UTF-8.
103
 
    </para>
104
 
    <para>length of each line in a file is limited to 4096 characters.</para>
105
 
  </refsection>
106
 
  <refsection>
107
 
    <title>Examples</title>
108
 
    <programlisting role="example"><![CDATA[ 
 
3
    <refnamediv>
 
4
        <refname>exec</refname>
 
5
        <refpurpose> script file execution</refpurpose>
 
6
    </refnamediv>
 
7
    <refsynopsisdiv>
 
8
        <title>Calling Sequence</title>
 
9
        <synopsis>exec(path [,mode])
 
10
            exec(fun [,mode])
 
11
            ierr=exec(path,'errcatch' [,mode])
 
12
            ierr=exec(fun,'errcatch' [,mode])
 
13
        </synopsis>
 
14
    </refsynopsisdiv>
 
15
    <refsection>
 
16
        <title>Arguments</title>
 
17
        <variablelist>
 
18
            <varlistentry>
 
19
                <term>path</term>
 
20
                <listitem>
 
21
                    <para>a string, the path of the script file</para>
 
22
                </listitem>
 
23
            </varlistentry>
 
24
            <varlistentry>
 
25
                <term>mode</term>
 
26
                <listitem>
 
27
                    <para>an integer scalar, the execution mode (see below)</para>
 
28
                </listitem>
 
29
            </varlistentry>
 
30
            <varlistentry>
 
31
                <term>fun</term>
 
32
                <listitem>
 
33
                    <para>a scilab function</para>
 
34
                </listitem>
 
35
            </varlistentry>
 
36
            <varlistentry>
 
37
                <term>ierr</term>
 
38
                <listitem>
 
39
                    <para>integer, 0 or error number</para>
 
40
                </listitem>
 
41
            </varlistentry>
 
42
        </variablelist>
 
43
    </refsection>
 
44
    <refsection>
 
45
        <title>Description</title>
 
46
        <para>
 
47
            <literal>exec(path [,mode])</literal> executes sequentialy the scilab instructions
 
48
            contained in the file given by <literal>path</literal>  with an optional 
 
49
            execution mode <literal>mode</literal> .
 
50
        </para>
 
51
        <para>
 
52
            The different cases for <literal>mode</literal> are :
 
53
        </para>
 
54
        <para>
 
55
            0 
 
56
            : the default value
 
57
        </para>
 
58
        <para>
 
59
            -1 
 
60
            : nothing is printed
 
61
        </para>
 
62
        <para>
 
63
            1 
 
64
            : echo of each command line
 
65
        </para>
 
66
        <para>
 
67
            2 
 
68
            : prompt <literal>--&gt;</literal> is printed
 
69
        </para>
 
70
        <para>
 
71
            3 
 
72
            : echoes + prompts
 
73
        </para>
 
74
        <para>
 
75
            4 
 
76
            : stops before each prompt. Execution resumes after a carriage return.
 
77
        </para>
 
78
        <para>
 
79
            7 
 
80
            : stops + prompts + echoes : useful mode for demos.
 
81
        </para>
 
82
        <para>
 
83
            <literal>exec(fun [,mode])</literal> executes function  <literal>fun</literal> as a script: no
 
84
            input nor output argument nor specific variable environment. This form
 
85
            is more efficient, because script code may be pre-compiled (see comp). This method for script evaluation allows to store scripts as
 
86
            function in libraries.
 
87
        </para>
 
88
        <para>
 
89
            If an error is encountered while executing, if 'errcatch' flag is
 
90
            present <literal>exec</literal> issues no error message, aborts execution of the
 
91
            instructions and resumes with <literal>ierr</literal> equal to the error
 
92
            number. If 'errcatch' flag is not present, standard error handling
 
93
            works.
 
94
        </para>
 
95
    </refsection>
 
96
    <refsection>
 
97
        <title>Remarks</title>
 
98
        <para>
 
99
            <literal>exec</literal> files may now be used to define functions using the inline function definition syntax (see function).
 
100
        </para>
 
101
        <para>
 
102
            <literal>exec</literal> supports files encoded as ANSI/ASCII and UTF-8.
 
103
        </para>
 
104
        <para>length of each line in a file is limited to 4096 characters.</para>
 
105
    </refsection>
 
106
    <refsection>
 
107
        <title>Examples</title>
 
108
        <programlisting role="example"><![CDATA[ 
109
109
// create a script file
110
110
mputl('a=1;b=2',TMPDIR+'/myscript')
111
111
 
128
128
// a and y are created in the current environment
129
129
whos -name "a "
130
130
 ]]></programlisting>
131
 
  </refsection>
132
 
  <refsection role="see also">
133
 
    <title>See Also</title>
134
 
    <simplelist type="inline">
135
 
      <member>
136
 
        <link linkend="execstr">execstr</link>
137
 
      </member>
138
 
      <member>
139
 
        <link linkend="evstr">evstr</link>
140
 
      </member>
141
 
      <member>
142
 
        <link linkend="comp">comp</link>
143
 
      </member>
144
 
      <member>
145
 
        <link linkend="mode">mode</link>
146
 
      </member>
147
 
      <member>
148
 
        <link linkend="chdir">chdir</link>
149
 
      </member>
150
 
      <member>
151
 
        <link linkend="pwd">pwd</link>
152
 
      </member>
153
 
    </simplelist>
154
 
  </refsection>
 
131
    </refsection>
 
132
    <refsection role="see also">
 
133
        <title>See Also</title>
 
134
        <simplelist type="inline">
 
135
            <member>
 
136
                <link linkend="execstr">execstr</link>
 
137
            </member>
 
138
            <member>
 
139
                <link linkend="evstr">evstr</link>
 
140
            </member>
 
141
            <member>
 
142
                <link linkend="comp">comp</link>
 
143
            </member>
 
144
            <member>
 
145
                <link linkend="mode">mode</link>
 
146
            </member>
 
147
            <member>
 
148
                <link linkend="chdir">chdir</link>
 
149
            </member>
 
150
            <member>
 
151
                <link linkend="pwd">pwd</link>
 
152
            </member>
 
153
        </simplelist>
 
154
    </refsection>
155
155
</refentry>