<?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_remove" xml:lang="en-US">
<title>listRemove</title>
<indexterm><primary>listRemove</primary></indexterm>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md397">
<title>autotoc_md397</title>
<para>title: ArmaRAMDb - List Remove icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md398">
<title>excerpt: Remove an element from a list stored at a key in RAMDb.</title></section>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md399">
<title>ramdb_db_fnc_listRemove</title><section xml:id="_md_docs_2list_2list_remove_1autotoc_md400">
<title>Description</title>
<para>Removes a specific element from a list stored at a specified key in the RAMDb database. This function allows for precise control over list content by targeting individual elements by their index, without affecting other elements in the list. This is particularly useful for removing outdated or no longer needed entries.</para>
</section>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md401">
<title>Syntax</title>
<para><literallayout><computeroutput>[_key,&#32;_index]&#32;call&#32;ramdb_db_fnc_listRemove
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md402">
<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>_key   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>The key identifying the list from which to remove an element   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para>_index   </para>
</entry><entry>
<para>Number   </para>
</entry><entry>
<para>The zero-based index of the element to remove from the list   </para>
</entry><entry>
<para>-1   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md403">
<title>Return Value</title>
<para>None. The operation runs synchronously to remove the element immediately.</para>
</section>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md404">
<title>Examples</title>
<para><emphasis role="bold">Remove the first element from an event log:</emphasis> <literallayout><computeroutput>[&quot;eventLog&quot;,&#32;0]&#32;call&#32;ramdb_db_fnc_listRemove;
</computeroutput></literallayout></para>

<para><emphasis role="bold">Remove a specific player record:</emphasis> <literallayout><computeroutput>[&quot;playerRecords&quot;,&#32;5]&#32;call&#32;ramdb_db_fnc_listRemove;
</computeroutput></literallayout></para>

<para><emphasis role="bold">Remove an element from a multiplayer environment:</emphasis> <literallayout><computeroutput>[&quot;sharedData&quot;,&#32;2]&#32;remoteExecCall&#32;[&quot;ramdb_db_fnc_listRemove&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md405">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>This function removes only the element at the specified index. All other elements remain unchanged, though their indices may shift.</para>
</listitem><listitem>
<para>The index is zero-based, meaning the first element is at index 0, the second at index 1, and so on.</para>
</listitem><listitem>
<para>If an invalid index is provided (negative or exceeding the list length), the operation will not remove any elements.</para>
</listitem><listitem>
<para>The <computeroutput>_key</computeroutput> parameter must be a non-empty string, otherwise the function will exit without performing any action.</para>
</listitem><listitem>
<para>After removing an element, all subsequent elements shift down by one index to maintain a contiguous list.</para>
</listitem><listitem>
<para>The removal operation is permanent and cannot be undone except by re-adding the element.</para>
</listitem><listitem>
<para>All list operations are logged for debugging purposes.</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2list_2list_remove_1autotoc_md406">
<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_listGet</computeroutput>: Retrieves a specific element from 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_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_remove_1autotoc_md407">
<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>
