<?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_load" xml:lang="en-US">
<title>listLoad</title>
<indexterm><primary>listLoad</primary></indexterm>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md386">
<title>autotoc_md386</title>
<para>title: ArmaRAMDb - List Load icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md387">
<title>excerpt: Get all elements of a list stored at a key from RAMDb.</title></section>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md388">
<title>ramdb_db_fnc_listLoad</title><section xml:id="_md_docs_2list_2list_load_1autotoc_md389">
<title>Description</title>
<para>Retrieves all elements of a list stored at a specified key from the RAMDb database. This function is useful when you need to access the complete list data rather than individual elements, allowing operations on the entire dataset. The retrieved data is passed to a callback function for processing.</para>
</section>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md390">
<title>Syntax</title>
<para><literallayout><computeroutput>[_key,&#32;_function,&#32;_call,&#32;_netId]&#32;call&#32;ramdb_db_fnc_listLoad
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md391">
<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 to be retrieved   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para>_function   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>The name of the function that will receive the retrieved data   </para>
</entry><entry>
<para>&quot;&quot;    </para>
</entry></row>
      <row  class='markdownTableRowOdd'>
<entry>
<para>_call   </para>
</entry><entry>
<para>Boolean   </para>
</entry><entry>
<para>Whether to call the function in an unscheduled environment   </para>
</entry><entry>
<para>false    </para>
</entry></row>
      <row  class='markdownTableRowEven'>
<entry>
<para>_netId   </para>
</entry><entry>
<para>String   </para>
</entry><entry>
<para>The NetID of the target to return data from the function (multiplayer only)   </para>
</entry><entry>
<para>&quot;&quot;   </para>
</entry></row>
    </tbody>
    </tgroup>
</informaltable>
</para>
</section>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md392">
<title>Return Value</title>
<para>No value is returned directly. The retrieved list data is passed to the specified callback function asynchronously.</para>
</section>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md393">
<title>Examples</title>
<para><emphasis role="bold">Retrieve all event logs:</emphasis> <literallayout><computeroutput>[&quot;events&quot;,&#32;&quot;myProject_fnc_processEventLogs&quot;]&#32;call&#32;ramdb_db_fnc_listLoad;
</computeroutput></literallayout></para>

<para><emphasis role="bold">Retrieve a player list with synchronous callback:</emphasis> <literallayout><computeroutput>[&quot;playerList&quot;,&#32;&quot;myProject_fnc_processPlayerList&quot;,&#32;true]&#32;call&#32;ramdb_db_fnc_listLoad;
</computeroutput></literallayout></para>

<para><emphasis role="bold">Send mission data to a specific client:</emphasis> <literallayout><computeroutput>[&quot;missionData&quot;,&#32;&quot;myProject_fnc_processMissionData&quot;,&#32;false,&#32;netId&#32;player]&#32;remoteExecCall&#32;[&quot;ramdb_db_fnc_listLoad&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md394">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>This function retrieves the entire list stored at the specified key, making it useful when you need to process multiple elements together.</para>
</listitem><listitem>
<para>Both the <computeroutput>_key</computeroutput> and <computeroutput>_function</computeroutput> parameters are required. The function will exit without action if either is empty.</para>
</listitem><listitem>
<para>The retrieved data is processed asynchronously through the scheduler system and passed to the specified callback function.</para>
</listitem><listitem>
<para>For multiplayer scenarios, you can specify a target client using the <computeroutput>_netId</computeroutput> parameter to send the retrieved data to that specific client.</para>
</listitem><listitem>
<para>The <computeroutput>_call</computeroutput> parameter determines whether the callback function is executed in an unscheduled environment (true) or scheduled environment (false).</para>
</listitem><listitem>
<para>This function uses the underlying &quot;listrng&quot; extension with a range from 0 to -1, which retrieves all elements in the list.</para>
</listitem><listitem>
<para>All list operations are logged for debugging purposes.</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2list_2list_load_1autotoc_md395">
<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_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_load_1autotoc_md396">
<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>
