Number of items

Bob Sneidar bobsneidar at iotecdigital.com
Mon Oct 25 11:38:54 EDT 2021


As I understand it, a blank end line is not counted as a line. It must have something in the line. Think of it like this. A list of lines is really a return delimited list. If there is only one line, and that line does not contain a return delimiter, it is still a line. The delimiter is really a delimiter for the next line. 

The same holds true for items, otherwise you could claim that items are being treated differently from lines, and call THAT a bug. You could take a 5 item string, replace comma with cr, and then have a 4 line string. 

It seems to make better sense if you think of the delimiter as being there for the next thing and not for the thing before. If there is no next thing then... well there is no next thing. 

If you REALLY want to have empty items, try putting NULL into them. 

put NULL & comma & NULL into tTest;put the number of items of tTest

Yields 2

put empty & comma & empty into tTest;put the number of items of tTest

Yields 1

Bob S


> On Oct 25, 2021, at 08:22 , Paul Dupuis via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Why is it a feature? (I'm sorry, I am sure it has been explained before in these lists)
> 
> I searched the Quality Center and could find no open bug entry for this. As LC 9.6.3 still gives and item count of ",1" as 2 and an item count of "1," as 1 that this is indeed the expected behavior?!?
> 
> I would have personally expected them both to be 2, but perhaps these is a reason trailing empty items are not counted?





More information about the use-livecode mailing list