ANY†
Format†
ANY( var )
Function†
- Select one element of the argument at random.
- If a string is given, it is assumed to be a simple array and one of its elements is selected at random and returned.
- If a general purpose array is given, one of its elements is selected at random and returned.
- If an integer or real number is given, it will be returned.
- The ordinal number of the selection can be obtained with LSO.
Arguments†
- var
- The string, general purpose array, integer, or real number to be selected from.
Return value†
- If successful, the converted value
- If unsuccessful, nothing is returned (VOID)
Related†
Version†
- YAYA: Available from the start
- Available in AYA5.8
Example†
_array = ('Sakura','Mayura','Nekoko') // Assign a general purpose array
ANY( _array ) // "Mayura" is output (one of the array elements is output at random)
_str = 'Sakura,Mayura,Nekoko' // Assign a simple array
ANY( _str ) // "Nekoko" is output (one of the array elements is output at random)
LSO // The integer `2` is output (since "Nekoko" is element 2 of the array)