Get file name from full path and name?

Klaus Major klaus at major-k.de
Wed Feb 8 17:50:16 EST 2006


Hi Garrett,

> Greetings,
>
> Searched the docs for anything that might do this, but can't find  
> anything....
>
> Does anyone know how to extract a file name and extension from a  
> full path, such as from "answer file" ?

...
answer file "Is there any beer left?"
if it = empty then exit mouseup ##or whatever
set the itemdel to "/"
put item -1 of it into t_filename
set the itemdel to "."
put item -1 of t_filename into t_suffix
put item 1 to -2 of t_filename into t_filename_without_suffix
...

Hope that helps :-)

> Thanks,
> -Garrett

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de




More information about the use-livecode mailing list