/*+-------------------------------------------------------------------------* * jrelative * * This is a replacement for the built-in "relative" function. It's * different from the built-in in that it will only modify filenames that * are below toDir, instead of prefixing with "..\" to build a relative * path. *-----------------------------------------------------------------(jeffro)-*/ _str jrelative (_str filename, _str toDir=null) { if (toDir == null) toDir = getcwd(); _str lastch = substr (toDir, length(toDir)); if (lastch != '\') toDir = toDir'\'; int toDir_length = length (toDir); if (substr (filename, 1, toDir_length) == toDir) filename = substr (filename, toDir_length+1); return (filename); }