DroidScript wiki

(was AndroidScript) unofficial documentation by the community

User Tools

Site Tools


sample_code:count_list-items

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
sample_code:count_list-items [2014/12/17 15:52]
octazid created
sample_code:count_list-items [2014/12/17 15:54]
octazid
Line 1: Line 1:
-======Count the List Items======+====== 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;​ 
 +
 +</​code>​
sample_code/count_list-items.txt · Last modified: 2016/07/28 11:10 by 80.187.99.31