contains or is in

Cubist at aol.com Cubist at aol.com
Fri Apr 1 20:24:19 EST 2005


On Apr 1, 2005, at 11:45 AM, Dar Scott wrote:
> On Apr 1, 2005, at 8:02 AM, Thomas McGrath III wrote:
>
>>   --if myAlias contains ".exe" or ".app" then
>
> if myAlias contains ".exe" or myAlias contains ".app" then
   You need to think more paranoid. How can you be *certain* that the 
substrings ".app" or ".exe" *won't* occur anyplace in a filename other than at the 
end? Better:

  put char -4 to -1 of myAlias into Fred
  if Fred = ".exe" or Fred = ".app" then

   Or even, since there *are* a few extensions out there which *aren't* three 
characters long:

  set the itemDelimiter to "."
  put item -1 of myAlias into Fred
  if Fred = "exe" or Fred = "app" then

   Hope this helps...


More information about the use-livecode mailing list