news |
info |
people |
software |
stuff |
If passed a folder name (with or without a colon on the end), it returns the parent folder of the folder.
Note that this routine doesn't check to see whether the file/folder exists or whether the path is legal.
function FL_FolderFromPath path -- given the path to a file, returns the folder that the file is in -- if the last character is a colon, get rid of it first if the last char of path is colon then delete last char of path end if -- set the item delimiter to colon instead of comma get the itemDelimiter set the itemDelimiter to colon -- take off stuff after (and including) last colon delete last item of path set the itemDelimiter to it put colon after path -- send back the result return path end FL_FolderFromPath