Skip to content
PeerHeer edited this page Dec 31, 2019 · 1 revision

Description

The listutils:all function checks if all elements in a list have a non-zero data get value.

Usage

Input is given using the listutils:in storage:

Field Meaning
List The list to check.

After defining the input, run the function listutils:all.

Errors

Errors that display when executing the listutils:all function as a player in debug mode.

Error Message
TBD TBD

Return values

Success

The success of the operation is stored in the $listutils.success listutils.out score. This score is 1 on success and 0 otherwise. The success is 0 when any element does not have a non-zero data get value.

Result

The result of the operation is stored in the $listutils.result listutils.out score and is equal to the success.

Example

Take the example list ExampleList: ["foo", "Hello World!", "", "bar"] in the listutils:examples storage:

# Add List to the input.
data modify storage listutils:in List set from storage listutils:examples ExampleList
# Call the function.
function listutils:all

This would return 0 in the $listutils.result listutils.out score, because there is an empty string at index 2.

Clone this wiki locally