<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="tableng">
  <refmeta>
    <refentrytitle>tableng</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>tableng</refname>
    <refpurpose>
      Interrogates a function table for length.
      <indexterm id="IndexTableng"><primary>tableng</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Interrogates a function table for length.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ir <command>tableng</command> ifn</synopsis>

    <synopsis>kr <command>tableng</command> kfn</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifn</emphasis> -- Table number to be interrogated
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>kfn</emphasis> -- Table number to be interrogated
    </para>

    <para>
      <emphasis>tableng</emphasis> returns the length of the specified table. This will be a power of two number in most circumstances. It will not show whether a table has a guardpoint or not. It seems this information is not available in the table's data structure. If the specified table is not found, then 0 will be returned.
    </para>

    <para>
      Likely to be useful for setting up code for table manipulation operations, such as <link linkend="tablemix"><citetitle>tablemix</citetitle></link> and <link linkend="tablecopy"><citetitle>tablecopy</citetitle></link>.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the tableng opcode. It uses the files <ulink url="examples/tableng.orc"><citetitle>tableng.orc</citetitle></ulink> and <ulink url="examples/tableng.sco"><citetitle>tableng.sco</citetitle></ulink>.

      <example>
        <title>Example of the tableng opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/tableng.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/tableng.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      The table is 16,384 samples long. So its output should include a line like this:
      <screen>
instr 1:  ilen = 16384.000
      </screen>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: Robin Whittle</member>
        <member>Australia</member>
        <member>May 1997</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>
  </refsect1>
</refentry>
