Counting Chars by ASCI Values

Jim Ault JimAultWins at yahoo.com
Wed Mar 1 17:15:39 EST 2006


correct.


On 3/1/06 12:35 PM, "Mark Smith" <mark at maseurope.net> wrote:

> In this case, we're counting delimiters - not items, so it I'm sure
> it should be the number of items -1, unless we have a trailing
> delimiter, when the item count and delimiter count are the same,
> hence the need for "& null" or testing the last char.
> 
> This is how it seems to work on my setup (rev 2.7, Mac OS X):
> 
> 1,2,3 = 3 items, 2 delimiters
> ,1,2,3 = 4 items (one empty), 3 delimiters
> 1,2,3, = 3 items, 3 delimiters - Rev doesn't count the implied empy
> item at the end.
> 
> 
> Cheers,
> 
> Mark
> 
> 
> On 1 Mar 2006, at 20:12, Jim Ault wrote:
> 
>>> Also, shouldn't the count be
>>> 'the number of items in textStr -1?
>> As I indicated in a previous post, it depends on what you are
>> trying to
>> count when you use items a measure.
>> 
>> If the last char of a string is the asciiChar, then the number of
>> items will
>> be one less than the true count, however, if null is appended, the
>> count
>> will be equal to the true count.
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the Use-livecode mailing list