parsed pathname - answer found

Phil Davis davis.phil at comcast.net
Tue Jan 27 15:42:08 EST 2004


Here is a simpler way:

  set the itemDelimiter to "/"
  put "/" & last item of vMyPath into vParsedPath

Phil Davis



> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com
> [mailto:use-revolution-bounces at lists.runrev.com]On Behalf Of Barry
> Levine
> Sent: Tuesday, January 27, 2004 12:33 PM
> To: use-revolution at lists.runrev.com
> Subject: parsed pathname - answer found
> 
> 
> As is usually the case, posting a question to the list prompts me to 
> re-double my efforts. My question was how to find the last part of a 
> pathname (after the last "/") given the entire path. Here's what I came 
> up with:
> 
> on mouseUp
>    put field "folderList" into vMyPath -- (the path was stored in that 
> field)
>    repeat with i = the number of chars in vMyPath down to 1
>      if char i of vMyPath = "/" then exit repeat
>      put char i of vMyPath before vParsedPath
>    end repeat
>    answer vParsedPath -- (or do anything else now that we have it)
> end mouseUp
> 
> Seems to work pretty well though I'm sure there's a more elegant method.
> 
> Ciao!
> 
> Barry
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution


More information about the use-livecode mailing list