Number of items property

Gregory Lypny gregory.lypny at videotron.ca
Wed Jun 9 14:08:19 EDT 2004


Hello everyone,

I've imported a tab-delimited text file into a field, which I know has 
11,000 data points in 1,000 lines and 11 columns.  A handler that 
counts the number of items in each line and tallies them confirms this. 
  However, the following handler, with the item delimiter set to tab and 
which uses the number function to count the number of items directly, 
gives me an answer of 10,001.

	put the number of items in fld "Data"  -- returns 10,001 and not 11,000

That's 999 short.  My guess is that the number function is not counting 
the last item on the end of each of the first 999 lines because those 
lines end with a carriage return and not a tab.  Any thoughts?  It 
seems to me that using the number function, applied to items as above, 
is more efficient and elegant than looping through the items in each 
line.  Is it safe to modify its use by simply adding the number of 
lines less one?  Something like this:
	
	put the number of items in fld "Data" + the number of lines in fld 
"Data" - 1

	Greg



More information about the use-livecode mailing list