This shows you the differences between two versions of the page.
sample_code:count_list-items [2014/12/17 15:54] octazid |
sample_code:count_list-items [2016/07/28 19:10] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Count the List-Items ====== | + | |
- | (Sample Code taken from the DroidScript Google-Group) | + | |
- | <code JavaScript list_item_count.js> | + | |
- | function GetListItemCount( list ) | + | |
- | { | + | |
- | //Get a comma separated string of items from the list | + | |
- | var itemString = list.GetList( "," | + | |
- | + | ||
- | //Split the comma separated item string into an array of items | + | |
- | var itemArray = itemString.split( "," | + | |
- | + | ||
- | return itemArray.length; | + | |
- | } | + | |
- | </ | + |