Unfortunately not, at least if you count items like I do :-)
The number of items of "a,b,c" is three and the number of items of "a,b," is
2, but I want that last empty item to be counted. But it's moot now anyway,
I've started to use an array with numbered keys instead of an item string
and that
Jacque-
Monday, August 22, 2011, 8:20:46 AM, you wrote:
> It's come up many times before. The delimiter belongs to the item before
> it. That's true of both items and lines. How many lines are in each of
> these examples:
> This is line one.
> This is line two.
> This is line one.
> This is l
Pete-
Monday, August 22, 2011, 10:14:18 AM, you wrote:
> Unfortunately, I don't know in advance how many items there are in the
> string, probably didn't explain that clearly but the root of the problem is
"the number of items of" will give you that.
--
-Mark Wieder
mwie...@ahsoftware.net
_
Unfortunately, I don't know in advance how many items there are in the
string, probably didn't explain that clearly but the root of the problem is
that I have to refer to item -1 of the string and "a,b,c" returns "c" and
"a,b," returns "b" - same number of delimiters, different result.
Wasn't the
I think it's the equivalent behavior of the last line. If the last char is a
cr, then the last line would be the last line with something in it. Makes sense
if you think about it.
Bob
On Aug 21, 2011, at 2:50 PM, Pete wrote:
> It seems that if the last item in a string is empty, then trying
On 8/22/11 1:12 AM, Pete wrote:
Thanks Jim and Mark. I think maybe I used the wrong word when I said
"expected" since that's kind of in the eye of the beholder! This beholder
finds it entirely unexpected. It means that a string of "a,b," is the same
as a string of "a,b" as far as number of ite
Ault wrote:
>
>> Yes, this is expected behavior.
>> If the last item or line delimiter is the delimiter char, then there is no
>> 'last item as empty'
>>
>> You could do a simple modification
>> put the last item of (myItemList & the itemDel) into the
hen there is no
> 'last item as empty'
>
> You could do a simple modification
>put the last item of (myItemList & the itemDel) into theLogicalLastItem
>
> Jim Ault
> Las Vegas
>
> --- On Sun, 8/21/11, Pete wrote:
>
> From: Pete
> Subject: Accessing t
1, Pete wrote:
From: Pete
Subject: Accessing the last item in a line
To: "How to use LiveCode"
Date: Sunday, August 21, 2011, 2:50 PM
It seems that if the last item in a string is empty, then trying to access
it by using "item -1" returns the penultimate item, not the last one.
Yes, this is expected behaviour. If you want to count the last item if it is
empty use
Item (number of items of (myVar & "x")) of myVar
--
Kind regards,
Mark Schonewille
Economy-x-Talk
Http://economy-x-talk.com
Share the clipboard of your computer over a local network with Clipboard Link
http
It seems that if the last item in a string is empty, then trying to access
it by using "item -1" returns the penultimate item, not the last one. For
example, given the string "a,b," item -1 of that string comes back as "b".
This is on LC 4.6.2, OS X 10.6.8. Is this expected behavior?
Pete
Moll
11 matches
Mail list logo