Ar All

From GECK
Jump to: navigation, search


A function added by the New Vegas Script Extender version 6.2.1.

Description

Takes an array and a function and returns true if all of the elements satisfy the function condition.

Syntax

[help]
(0/1) ar_All source:array conditionFunction:function/lambda 

Example

array_var aIter
array_var aNumbers = ar_List 1, 30, 39, 29, 10, 13
if ar_All aNumbers ({aIter} => *aIter < 40 ) ; returns 1
  print "success!"
endif

Notes

  • To see why the * operator is used and why aIter is an array_var, see Dereference/Unbox in NVSE Expressions.
  • aIter["key"] will contain the index of aNumbers. If aNumbers was a String Map then it would contain the string key.

See Also