dragonfly/docs/list/listRemove.md
Jacob Schmidt c8d81ba3bb
All checks were successful
Build / Build (push) Successful in 39s
docs: Update README.md with detailed documentation
This commit significantly enhances the `README.md` file, providing comprehensive documentation for the ArmaDragonflyClient.

Key changes:

*   **Detailed Function Categories:** Categorized functions for better organization (Core, Basic Data Operations, Hash Operations, List Operations).
*   **Usage Examples:** Added clear and concise usage examples for basic operations, hash operations (context and ID-specific), and list operations.
*   **Function Documentation Structure:** Outlined the structure for individual function documentation.
*   **License Information:** Updated the license information.
2025-03-30 17:15:35 -05:00

2.5 KiB

title, icon, excerpt
title icon excerpt
ArmaDragonflyClient - List Remove mdi:file-text-outline Remove an element from a list stored at a key in DragonflyClient.

dragonfly_db_fnc_listRemove

Description

Removes a specific element from a list stored at a specified key in the DragonflyClient 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.

Syntax

[_key, _index] call dragonfly_db_fnc_listRemove

Parameters

Parameter Type Description Default
_key String The key identifying the list from which to remove an element ""
_index Number The zero-based index of the element to remove from the list -1

Return Value

None. The operation runs synchronously to remove the element immediately.

Examples

Remove the first element from an event log:

["eventLog", 0] call dragonfly_db_fnc_listRemove;

Remove a specific player record:

["playerRecords", 5] call dragonfly_db_fnc_listRemove;

Remove an element from a multiplayer environment:

["sharedData", 2] remoteExecCall ["dragonfly_db_fnc_listRemove", 2, false];

Notes

  • This function removes only the element at the specified index. All other elements remain unchanged, though their indices may shift.
  • The index is zero-based, meaning the first element is at index 0, the second at index 1, and so on.
  • If an invalid index is provided (negative or exceeding the list length), the operation will not remove any elements.
  • The _key parameter must be a non-empty string, otherwise the function will exit without performing any action.
  • After removing an element, all subsequent elements shift down by one index to maintain a contiguous list.
  • The removal operation is permanent and cannot be undone except by re-adding the element.
  • All list operations are logged for debugging purposes.
  • dragonfly_db_fnc_listAdd: Adds an element to a list
  • dragonfly_db_fnc_listGet: Retrieves a specific element from a list
  • dragonfly_db_fnc_listLoad: Retrieves a range of elements from a list
  • dragonfly_db_fnc_listSet: Replaces a specific element in a list
  • dragonfly_db_fnc_scheduler: Processes the callback from the database extension

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