Finding In Reverse

Jim Ault JimAultWins at yahoo.com
Wed Jul 5 15:28:30 EDT 2006


On 7/5/06 11:05 AM, "Robert Sneidar" <bobs at twft.com> wrote:
> Of course I  
> must now correct you to some degree, because properly I should first
> save the old delimiter, and afterwards restore it.

If you call a function, there is no need to remember the old delim

on processString
   put item 1 of "cat,dog,mouse,cow" into animal
   put lastItem("first/second/third/fourth") into ending
   put item 2 of "cat,dog,mouse,cow" after animal
   put animal & cr & ending into msg
end processString

function lastItem str
   set the itemDel to "/"
--this applies only to this scope
--which means it is 'forgotten' when this handler finishes
   return item -1 of str
end lastItem

Jim Ault
Las Vegas





More information about the use-livecode mailing list