
This commit updates the documentation to reflect the current function names and link structure. Specifically, it addresses the following: * Corrected internal links within the documentation to point to the correct markdown files (e.g., `hashDelete.md` instead of `hashDelete`). * Updated related function references to reflect the current function names and include missing functions. * Removed outdated function references. * Added `ramdb_db_fnc_scheduler` to related functions where appropriate. * Updated the links section to use the correct markdown file names.
2.5 KiB
2.5 KiB
title, icon, excerpt
title | icon | excerpt |
---|---|---|
ArmaRAMDb - List Remove | mdi:file-text-outline | Remove an element from a list stored at a key in RAMDb. |
ramdb_db_fnc_listRemove
Description
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.
Syntax
[_key, _index] call ramdb_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 ramdb_db_fnc_listRemove;
Remove a specific player record:
["playerRecords", 5] call ramdb_db_fnc_listRemove;
Remove an element from a multiplayer environment:
["sharedData", 2] remoteExecCall ["ramdb_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.
Related Functions
ramdb_db_fnc_listAdd
: Adds an element to a listramdb_db_fnc_listGet
: Retrieves a specific element from a listramdb_db_fnc_listLoad
: Retrieves a range of elements from a listramdb_db_fnc_listSet
: Replaces a specific element in a listramdb_db_fnc_listDelete
: Deletes an entire listramdb_db_fnc_scheduler
: Processes the callback from the database extension
Links
List Add | List Delete | List Get | List Load | List Remove | List Set