Length of
This section is available only in EnglishBlock returns length of iterable sequence.
- string - returns length of string (number of characters)
- list - returns amount of elements in list
- dict - amount of keys in dict
If input value is not iterable returns -1 as it’s length.
XML representation of function_length block
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="function_length">
<value name="VALUE">
<block type="text">
<field name="TEXT">Value</field>
</block>
</value>
</block>
</xml>
This block is used three times in the example:
- “set status_length” row: gets number of characters from variable “status”. Result is value “6”.
- “user_length” row: gets number of characters from “user” key in “item” dictionary. Result is value “13”.
- “if length of” row: gets number of characters from “user” key in “item” dictionary and if the value is greater or equal to “6”, user tag “long_username” is created.