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

Next revision
Previous revision
sample_code:count_list-items [2014/12/17 15:52]
octazid created
sample_code:count_list-items [2016/07/28 19:10] (current)
Line 1: Line 1:
-======Count the List Items======+====== Count the List-Items ====== 
 + 
 +**obsolete:** use ''list.GetLength()'' instead 
 + 
 +(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.1418831568.txt.gz · Last modified: 2014/12/17 23:52 (external edit)