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

Description

The listutils:any function checks if any element in a list has 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:any.

Errors

Errors that display when executing the listutils:any 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 all elements have a data get value of zero.

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:any

This would return 1 in the $listutils.result listutils.out score.

Clone this wiki locally