ArmaDragonflyClient |

Loading...
Searching...
No Matches
listLoad

## autotoc_md307

title: ArmaDragonflyClient - List Load icon: mdi:file-text-outline

## excerpt: Get all elements of a list stored at a key from DragonflyClient.

# dragonfly_db_fnc_listLoad

## Description

Retrieves all elements of a list stored at a specified key from the DragonflyClient 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.

## Syntax

[_key, _function, _call, _netId] call dragonfly_db_fnc_listLoad

## Parameters

Parameter | Type | Description | Default
--- | --- | --- | ---
_key | String | The key identifying the list to be retrieved | ""
_function | String | The name of the function that will receive the retrieved data | ""
_call | Boolean | Whether to call the function in an unscheduled environment | false
_netId | String | The NetID of the target to return data from the function (multiplayer only) | ""

## Return Value

No value is returned directly. The retrieved list data is passed to the specified callback function asynchronously.

## Examples

Retrieve all event logs:

["events", "myProject_fnc_processEventLogs"] call dragonfly_db_fnc_listLoad;

Retrieve a player list with synchronous callback:

["playerList", "myProject_fnc_processPlayerList", true] call dragonfly_db_fnc_listLoad;

Send mission data to a specific client:

["missionData", "myProject_fnc_processMissionData", false, netId player] remoteExecCall ["dragonfly_db_fnc_listLoad", 2, false];

## Notes

- This function retrieves the entire list stored at the specified key, making it useful when you need to process multiple elements together.
- Both the `_key` and `_function` parameters are required. The function will exit without action if either is empty.
- The retrieved data is processed asynchronously through the scheduler system and passed to the specified callback function.
- For multiplayer scenarios, you can specify a target client using the `_netId` parameter to send the retrieved data to that specific client.
- The `_call` parameter determines whether the callback function is executed in an unscheduled environment (true) or scheduled environment (false).
- This function uses the underlying "listrng" extension with a range from 0 to -1, which retrieves all elements in the list.
- All list operations are logged for debugging purposes.

## Related Functions

- `dragonfly_db_fnc_listAdd`: Adds an element to a list
- `dragonfly_db_fnc_listGet`: Retrieves a specific element from a list
- `dragonfly_db_fnc_listSet`: Replaces a specific element in a list
- `dragonfly_db_fnc_listRemove`: Removes a specific element from a list
- `dragonfly_db_fnc_scheduler`: Processes the callback from the database extension

## Links

List Add | List Get | List Load | List Remove | List Set