an open-source digital signal processing and sound synthesis language
about · links · contact
len - return the length of the argument


Synopsis

val = len(item)


Description

len will return the length of the argument item. If it is a array, it returns the number of elements in the array. If it is a string, it returns the number of characters in the string. For other types it returns "1" (note: this includes pfield-handles and table-handles -- see the tablelen scorefile command for accessing table lengths).


Arguments

item
The item to be checked for length


Examples

After parsing he following scorefile segment:

   arr = { 1, 2, 3 }
   val1 = len(arr)
   val2 = len("hey there")
val1 will be set to 3, and val2 will be set to 9.


See Also

tablelen, type