<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Scilab ( https://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) 2002 - INRIA
 * Copyright (C) 2012 - DIGITEO - Allan CORNET
 * Copyright (C) 2012 - 2016 - Scilab Enterprises
 * Copyright (C) 2018 - Samuel GOUGEON
 *
 * This file is hereby licensed under the terms of the GNU GPL v2.0,
 * pursuant to article 5.3.4 of the CeCILL v.2.1.
 * This file was originally licensed under the terms of the CeCILL v2.1,
 * and continues to be available under such terms.
 * For more information, see the COPYING file which you should have received
 * along with this program.
    *
    -->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
          xmlns:scilab="http://www.scilab.org" xml:id="lines" xml:lang="en">
    <refnamediv>
        <refname>lines</refname>
        <refpurpose>sets and queries the display width and pagination for the console</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Syntax</title>
        <synopsis>
            lines(nl)
            lines(nl, nc)
            lines(ncl)
            ncl = lines()
        </synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>nl</term>
                <listitem>
                    <para>An integer, the number of lines for vertical paging control.</para>
                    <itemizedlist>
                        <listitem>
                            <para>If 0: no vertical paging control is done.</para>
                        </listitem>
                        <listitem>
                            <para>If -1: reset vertical paging control to current size of the window.</para>
                        </listitem>
                    </itemizedlist>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>nc</term>
                <listitem>
                    <para>An integer, the number of column of output. Used for
                        formatting output
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>ncl</term>
                <listitem>
                    <para>A 1x2 vector [nc, nl]</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>lines</literal> handles Scilab display paging.
        </para>
        <para>
            <literal>lines()</literal> returns the vector <literal>[# columns, #
                rows]
            </literal>
            currently used by Scilab for displaying the
            results.
        </para>
        <para>
            <literal>lines(nl)</literal> sets the number of displayed lines
            (before user is asked for more) to <literal>nl</literal>.
        </para>
        <para>
            <literal>lines(0)</literal> disables vertical paging.
        </para>
        <para>
            <literal>lines(nl,nc)</literal> and <literal>lines([nc,nl])</literal> changes also the size of the output
            to <literal>nc</literal> columns.
        </para>
        <para>When Scilab is launched without -nw option, the
            <literal>lines</literal> parameters are automatically set according to the
            output window size, these parameters are also automatically modified when
            the window is resized.
        </para>
    </refsection>
    <refsection>
        <title>Examples</title>
        <programlisting role="example"><![CDATA[
lines(0,100)
rand(2,8)

lines(0,65)
rand(2,8)
   ]]></programlisting>
      <screen><![CDATA[
--> lines(0,100)
--> rand(2,8)
 ans  =
   0.2113249   0.0002211   0.6653811   0.8497452   0.8782165   0.5608486   0.7263507   0.5442573
   0.7560439   0.3303271   0.6283918   0.685731    0.068374    0.6623569   0.1985144   0.2320748

--> lines(0,65)
--> rand(2,8)
 ans  =
         column 1 to 5
   0.2312237   0.8833888   0.3076091   0.2146008   0.3616361
   0.2164633   0.6525135   0.9329616   0.312642    0.2922267

         column 6 to 8
   0.5664249   0.3321719   0.5015342
   0.4826472   0.5935095   0.4368588
]]></screen>
    </refsection>
    <refsection role="see also">
        <title>See also</title>
        <simplelist type="inline">
            <member>
                <link linkend="mode">mode</link>
            </member>
            <member>
                <link linkend="format">format</link>
            </member>
            <member>
                <link linkend="disp">disp</link>
            </member>
            <member>
                <link linkend="print">print</link>
            </member>
            <member>
                <link linkend="clc">clc</link>
            </member>
        </simplelist>
    </refsection>
    <refsection>
        <title>History</title>
        <revhistory>
            <revision>
                <revnumber>5.4.0</revnumber>
                <revdescription>
                    <itemizedlist>
                        <listitem>lines is set by default to 0. Argument -1 added. See SEP #67 for more information.</listitem>
                        <listitem>lines manages a 1x2 vector [nc, nl] as input argument
                        </listitem>
                    </itemizedlist>
                </revdescription>
            </revision>
        </revhistory>
    </refsection>
</refentry>
