>>for a few minutes I realized that it

would be easier with arrays.

I worked with "/" delimited lists. It probabilly makes it simpler.

Here is the code. Sorry, no comments for the time being.
It gives me the relative path in "scriptDirecory" which I can use for any file 
like javascript, css, etc.
<CFSCRIPT>
 relativePath = "";
 l = 0;
 temp = "";
 baseDir = lCase(replace (GetDirectoryFromPath(GetBaseTemplatePath()), "\", 
"/", "all"));
 base = baseDir;
 pathDir = lCase(replace (GetDirectoryFromPath(GetCurrentTemplatePath()), "\", 
"/", "all"));
 path = pathDir;
 while (listLen(base, "/") GT 0 AND listLen(path, "/") GT 0)
 {
 temp = listFirst(base, "/");
 if(temp EQ listFirst(path, "/"))
  {
  relativePath = listAppend(relativePath, temp, "/");
  base = listDeleteAt (base,1, "/");
  path = listDeleteAt (path,1, "/");
  l = l + len(temp)+1;
  }
 else  {
  scriptDirectory = RepeatString("../", listLen(temp, "/")) & mid (pathDir, 
l+1, 99999);  base = "";
  }
 }
</CFSCRIPT>

-- 
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193470
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to