news |
info |
people |
software |
stuff |
This routine checks to see whether the path is too long. If it is, it takes the words before the first colon, and the words after the last colon, and replaces the bit in the middle with ":É:".
Note that this may still result in a string that is larger than the limit size that was passed.
function FL_ShortPath path,limit -- returns abbreviated version of a path (for display) -- if limit isn't passed, use default limit of 20 if limit is empty then put 20 into limit end if -- if path is longer than the limit, truncate it if length(path) > limit then get the itemDelimiter set the itemDelimiter to ":" put first item of path into start put last item of path into finish put start & ":...:" & finish into path set the itemDelimiter to it end if -- return path, possible modified return path end FL_ShortPath