<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_md_docs_2list_2list_get" xml:lang="en-US">
<title>listGet</title>
<indexterm><primary>listGet</primary></indexterm>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md372">
<title>autotoc_md372</title>
<para>title: ArmaRAMDb - List Get icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md373">
<title>excerpt: Get element of list stored at key from RAMDb.</title></section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md374">
<title>ramdb_db_fnc_listGet</title><section xml:id="_md_docs_2list_2list_get_1autotoc_md375">
<title>Description</title>
<para>Retrieves a specific element from a list stored in the database by its index. This function accesses a single item from a list using its position number and returns the data through a callback function. It&apos;s useful for accessing individual pieces of data from a sequence without retrieving the entire list.</para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md376">
<title>Syntax</title>
<para><literallayout><computeroutput>[_key,&#32;_index,&#32;_function,&#32;_call,&#32;_netId]&#32;call&#32;ramdb_db_fnc_listGet
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md377">
<title>Parameters</title>
<para><informaltable frame="all">
    <tgroup cols="4" align="left" colsep="1" rowsep="1">
      <colspec colname='c1'/>
      <colspec colname='c2'/>
      <colspec colname='c3'/>
      <colspec colname='c4'/>
<thead>
      <row  class='markdownTableHead'>
<entry>
<para>Parameter   </para>
</entry><entry>
<para>Type   </para>
</entry><entry>
<para>Description   </para>
</entry><entry>
<para>Default    </para>
</entry></row>
</thead><tbody>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_key</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>Name of the list   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para><computeroutput>_index</computeroutput>   </para>
</entry><entry>
<para>Number   </para>
</entry><entry>
<para>Index position of the element to retrieve (0-based)   </para>
</entry><entry>
<para>-1    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_function</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>Name of the function to receive the retrieved data   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para><computeroutput>_call</computeroutput>   </para>
</entry><entry>
<para>Boolean   </para>
</entry><entry>
<para>Whether to call the function directly (true) or spawn (false)   </para>
</entry><entry>
<para>false    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para><computeroutput>_netId</computeroutput>   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>(Optional) NetID of the player to receive the data   </para>
</entry><entry>
<para>&quot;&quot;   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md378">
<title>Return Value</title>
<para>None. The retrieved data is passed to the specified callback function asynchronously.</para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md379">
<title>Examples</title><section xml:id="_md_docs_2list_2list_get_1autotoc_md380">
<title>Retrieve a specific event log entry:</title>
<para><literallayout><computeroutput>[&quot;events&quot;,&#32;0,&#32;&quot;ramdb_db_fnc_test&quot;]&#32;call&#32;ramdb_db_fnc_listGet;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md381">
<title>Retrieve data with synchronous callback:</title>
<para><literallayout><computeroutput>[&quot;messages&quot;,&#32;5,&#32;&quot;ramdb_db_fnc_processMessage&quot;,&#32;true]&#32;call&#32;ramdb_db_fnc_listGet;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md382">
<title>Retrieve data and send it to a specific client:</title>
<para><literallayout><computeroutput>[&quot;notifications&quot;,&#32;0,&#32;&quot;ramdb_db_fnc_displayNotification&quot;,&#32;false,&#32;netId&#32;player]&#32;remoteExecCall&#32;[&quot;ramdb_db_fnc_listGet&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md383">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>Retrieves a single element from a list by its index position</para>
</listitem><listitem>
<para>The key, index, and function parameters are required and validated</para>
</listitem><listitem>
<para>Index is zero-based (the first element is at index 0)</para>
</listitem><listitem>
<para>If the index is out of bounds or the list doesn&apos;t exist, no data will be returned</para>
</listitem><listitem>
<para>The data is retrieved asynchronously through the extension&apos;s callback system</para>
</listitem><listitem>
<para>When a netId is provided, the data is sent to that specific client</para>
</listitem><listitem>
<para>The <computeroutput>_call</computeroutput> parameter determines whether the function is called directly (synchronous) or spawned (asynchronous)</para>
</listitem><listitem>
<para>For retrieving multiple elements, use <computeroutput>listLoad</computeroutput> instead</para>
</listitem><listitem>
<para>All operations are logged for debugging purposes</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md384">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>ramdb_db_fnc_listAdd</computeroutput>: Adds an element to a list</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_listLoad</computeroutput>: Retrieves a range of elements from a list</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_listSet</computeroutput>: Replaces a specific element in a list</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_listRemove</computeroutput>: Removes a specific element from a list</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_listDelete</computeroutput>: Deletes an entire list</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_scheduler</computeroutput>: Processes the callback from the database extension</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2list_2list_get_1autotoc_md385">
<title>Links</title>
<para><link linkend="_md_docs_2list_2list_add">List Add</link> | <link linkend="_md_docs_2list_2list_delete">List Delete</link> | <link linkend="_md_docs_2list_2list_get">List Get</link> | <link linkend="_md_docs_2list_2list_load">List Load</link> | <link linkend="_md_docs_2list_2list_remove">List Remove</link> | <link linkend="_md_docs_2list_2list_set">List Set</link> </para>
</section>
</section>
</section>
