<?xml version="1.0" encoding="UTF-8"?>
<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" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="who">
    <refnamediv>
        <refname>who</refname>
        <refpurpose>listing of variables</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>who
            who()
            [names, mem] = who(scope)
            [names, mem] = who(scope, sorted)
            [names, mem] = who(sorted)
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>scope</term>
                <listitem>
                    <para>
                        <literal>"local"</literal> or <literal>"get"</literal>: list visible variables (not only in current function).
                    </para>
                    <para>
                        <literal>"scope"</literal> or <literal>"current"</literal>: list variables in the current scope/function.
                    </para>
                    <para>
                        <literal>"global"</literal>: list global variables.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>sorted</term>
                <listitem>
                    <para>
                        Boolean value to specify if output must be sort in alphabetical order.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>names</term>
                <listitem>
                    <para>String matrix with variable names.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>mem</term>
                <listitem>
                    <para>Double matrix with variable used memory in bytes.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
[a, b] = (1, 2);
[name, mem] = who("local");
position = find(name=="a")
mem(position) // Size used by a
position = find(name=="d") // []

function foo(a,b)
    disp(who("scope", "sorted"))
endfunction
foo(1,2);
     ]]></programlisting>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="whos">whos</link>
            </member>
            <member>
                <link linkend="who_user">who_user</link>
            </member>
            <member>
                <link linkend="macrovar">macrovar</link>
            </member>
        </simplelist>
    </refsection>
    <refsection role="history">
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>6.0.1</revnumber>
                <revdescription>
                    Add "scope" or "current" scope.
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
