>???
>this trick is the same as it ever was = the easiest way to zero a list ...
It didn't used to work that way, at least a long time ago...
>tList = []
>tList[100] = 0 -- sets the first 100 elements = 0
>
>but I don't see how this is relevant.
Well, like you, I thought that the question was directed at an index into
a list, rather than an index into a string. The code was just to
demonstrate that count() was the way to get the "lastIndex".
But, since Michael was looking for a string function, you're right, it
isn't relevant. ;-)
More relevent: While I also use the "last item" approach rather than
using a repeat loop to get the file name, the problem can also be solved
more generally using recursion, thusly:
on chop theString, delimiter
if theString contains delimiter then
theString = chop(theString.char[offset(delimiter, theString) +
1..length(theString)], delimiter)
return theString
else
return theString
end if
end chop
(Note that for clarity, I use "+ 1", so the above code only works for
single char delimiters. Really, it should be "+ length(delimiter)")
The reason I point the recursive approach out is that it's a great way to
do string replacements, such as when you need to swap colons for slashes
or such. (Although you can now do replacements in javascript syntax
pretty easily.)
>BTW - Tom, did you get elected?
Nope. It was a bad night to be a Republican in the Commonwealth of
Virginia.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]