Number of items property
Gregory Lypny
gregory.lypny at videotron.ca
Wed Jun 9 17:24:51 EDT 2004
Wow! Thanks for all your great responses to my post (below). In
particular, Mark Brownell's suggestion of replacing cr with tab & cr
will cause the number of items to return the correct result of 11,000.
Thanks again,
Greg
On Jun 9, 2004, at 4:15 PM, I wrote wrote:
> Message: 3
> Date: Wed, 09 Jun 2004 14:08:19 -0400
> From: Gregory Lypny <gregory.lypny at videotron.ca>
> Subject: Number of items property
> To: Revolution <use-revolution at lists.runrev.com>
> Message-ID: <FCCC5D96-BA3F-11D8-B036-000D9350C9C2 at videotron.ca>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> 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
>
More information about the use-livecode
mailing list