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

« back to all changes in this revision

Viewing changes to modules/api_scilab/help/en_US/low_level_functions/ReturnArguments.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:xi="http://www.w3.org/2001/XInclude" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="ReturnArguments">
3
 
  <refnamediv>
4
 
    <refname>ReturnArguments</refname>
5
 
    <refpurpose>
6
 
      A C gateway function which returns the various variables.
7
 
    </refpurpose>
8
 
  </refnamediv>
9
 
  <refsynopsisdiv>
10
 
    <title>Calling Sequence</title>
11
 
    <synopsis>ReturnArguments();</synopsis>
12
 
  </refsynopsisdiv>
13
 
  <refsection>
14
 
    <title>Description</title>
15
 
    <para>
16
 
      ReturnArguments() will return the various variables declared through 
17
 
      AssignOutputVariable(X).
18
 
    </para>
19
 
  </refsection>
20
 
  <refsection>
21
 
    <title>Examples</title>
22
 
    <para>This example takes a matrix of doubles as input and returns:</para>
23
 
    <itemizedlist>
24
 
      <listitem>
25
 
        <para>the number of lines (first output argument)</para>
26
 
      </listitem>
27
 
      <listitem>
28
 
        <para>the number of rows (second output argument)</para>
29
 
      </listitem>
30
 
    </itemizedlist>
31
 
    <programlisting role="example"><![CDATA[
 
3
    <refnamediv>
 
4
        <refname>ReturnArguments</refname>
 
5
        <refpurpose>
 
6
            A C gateway function which returns the various variables.
 
7
        </refpurpose>
 
8
    </refnamediv>
 
9
    <refsynopsisdiv>
 
10
        <title>Calling Sequence</title>
 
11
        <synopsis>ReturnArguments(pvApiCtx);</synopsis>
 
12
    </refsynopsisdiv>
 
13
    <refsection>
 
14
        <title>Description</title>
 
15
        <para>
 
16
            ReturnArguments(pvApiCtx) will return the various variables declared through
 
17
            AssignOutputVariable(pvApiCtx, X).
 
18
        </para>
 
19
    </refsection>
 
20
    <refsection>
 
21
        <title>Examples</title>
 
22
        <para>This example takes a matrix of doubles as input and returns:</para>
 
23
        <itemizedlist>
 
24
            <listitem>
 
25
                <para>the number of lines (first output argument)</para>
 
26
            </listitem>
 
27
            <listitem>
 
28
                <para>the number of rows (second output argument)</para>
 
29
            </listitem>
 
30
        </itemizedlist>
 
31
        <programlisting role="example">
 
32
            <![CDATA[
32
33
#include "api_scilab.h"
33
34
int sci_mysizedouble(char * fname, unsigned long fname_len)
34
35
{
53
54
                return 0;
54
55
        }
55
56
 
56
 
    sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument + 1, 1, 1, &m_in_row); // the m_in_row parameter handles the number of lines of the matrix sent as argument
57
 
    sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument + 2, 1, 1, &m_in_row); // store a same value, but will neither be used nor returned to Scilab
58
 
    sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument + 3, 1, 1, &n_in_col); // the n_in_col parameter handles the number of columns of the matrix sent as argument
 
57
    sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 1, 1, 1, &m_in_row); // the m_in_row parameter handles the number of lines of the matrix sent as argument
 
58
    sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 2, 1, 1, &m_in_row); // store a same value, but will neither be used nor returned to Scilab
 
59
    sciErr = createMatrixOfInteger32(pvApiCtx, nbInputArgument(pvApiCtx) + 3, 1, 1, &n_in_col); // the n_in_col parameter handles the number of columns of the matrix sent as argument
59
60
 
60
 
    AssignOutputVariable(1) = nbInputArgument + 1; // We set the parameter "nbInputArgument + 1" as an output argument
61
 
    AssignOutputVariable(2) = nbInputArgument + 3; // We set the parameter "nbInputArgument + 3" as an output argument
62
 
    ReturnArguments();
 
61
    AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1; // We set the parameter "nbInputArgument(pvApiCtx) + 1" as an output argument
 
62
    AssignOutputVariable(pvApiCtx, 2) = nbInputArgument(pvApiCtx) + 3; // We set the parameter "nbInputArgument(pvApiCtx) + 3" as an output argument
 
63
    ReturnArguments(pvApiCtx);
63
64
    return 0;
64
65
}
65
 
 ]]></programlisting>
66
 
  </refsection>
 
66
 ]]>
 
67
        </programlisting>
 
68
    </refsection>
67
69
</refentry>