<!--
* 
*
*  ProLinga-Doc
*
*  Copyright (C) 2002-2008 Xobas Software.
*  All rights reserved.
*  
*  This file is part of ProLinga-Doc.
*
*  ProLinga-Doc is free software: you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  ProLinga-Doc is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  You should have received a copy of the GNU General Public License
*  along with ProLinga-Doc.  If not, see <http://www.gnu.org/licenses/>.
*
*  More information is available at the following addresses:
*
*  Website     : http://www.prolinga.org
*
*  Email       : prolinga-list@prolinga.org
*
*
-->
<refentry id="cmd_text">
  <refmeta>
    <refentrytitle>TEXT Command</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>TEXT</refname>
    <refpurpose>Process text documents.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>TEXT</command>
      <arg choice='plain'><option>APPEND</option></arg>
      <arg choice='plain'><replaceable>text_document_name</replaceable></arg>
      <arg choice='plain'><option>VALUE</option></arg>
      <arg choice='plain'><replaceable>data_ref</replaceable></arg>
      <arg rep='repeat' choice='opt'><replaceable>data_ref</replaceable></arg>
      <arg choice='opt'><option>NEWLINE()</option></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>TEXT</command>
      <arg choice='plain'><option>LOAD</option></arg>
      <arg choice='plain'><replaceable>text_document_name</replaceable></arg>
      <arg choice='plain'><option>FROM</option></arg>
      <arg choice='plain'>
        <group choice='req'>
          <arg choice='plain'>
            <arg choice='plain'><option>FILE</option></arg>
            <arg choice='plain'><replaceable>ext_file_name</replaceable></arg>
          </arg>
          <arg choice='plain'>
            <arg choice='plain'><option>XML</option></arg>
            <arg choice='plain'><replaceable>xml_document_name</replaceable></arg>
          </arg>
        </group>
      </arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>TEXT</command>
      <arg choice='plain'><option>READ</option></arg>
      <arg choice='plain'><replaceable>text_document_name</replaceable></arg>
      <arg choice='plain'><option>LINENO</option></arg>
      <arg choice='plain'><replaceable>line_no</replaceable></arg>
      <arg choice='plain'><option>RETURNING</option></arg>
      <arg choice='plain'><replaceable>dest_ref</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>TEXT</command>
      <arg choice='plain'><option>SAVE</option></arg>
      <arg choice='plain'><replaceable>text_document_name</replaceable></arg>
      <arg choice='plain'><option>TO</option></arg>
      <arg choice='plain'><option>FILE</option></arg>
      <arg choice='plain'><replaceable>ext_file_name</replaceable></arg>
      <arg choice='opt'>
        <arg choice='plain'><option>MODE</option></arg>
        <arg choice='plain'><option>OVERWRITE</option></arg>
      </arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id="cmd_text_introduction">
    <title>Introduction</title>
    <para>
      The <link linkend="cmd_text">TEXT</link> command processes text documents. 
      Status of the executed command can be retrieved using built-in function 
      TEXTSTATUS().
    </para>
  </refsect1>
  <refsect1 id="cmd_text_arguments">
    <title>Arguments</title>
    <variablelist>
      <varlistentry>
	<term><replaceable>text_document_name</replaceable></term>
	<listitem>
	  <simpara>
            Name of the text memory buffer to write to.
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><replaceable>data_ref</replaceable></term>
	<listitem>
	  <simpara>
            Any data reference as well as hard coded string or numeric value. 
            The built-in function NEWLINE() can be used as data_ref to split 
            up lines.
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><replaceable>dest_ref</replaceable></term>
	<listitem>
	  <simpara>
            Any data reference which can hold text data.
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><replaceable>ext_file_name</replaceable></term>
	<listitem>
	  <simpara>
            Path and name of an external file.
	  </simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><replaceable>line_no</replaceable></term>
	<listitem>
	  <simpara>
            line number in the text buffer.
	  </simpara>
	</listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1 id="cmd_text_example">
    <title>Example</title>
<programlisting>
. . .
. . .
TEXT APPEND t1 "This is a line to append" NEWLINE()
. . .
. . .
</programlisting>
  </refsect1>

  <refsect1 id="cmd_text_related">
    <title>Related Commands</title>
    <para>
      <link linkend="cmd_clear">CLEAR</link>
    </para>
  </refsect1>

</refentry>

