so you have a string /MyApplication/Level1/Level2/index.cfm, and you want to return /Level1/Level2/index.cfm? use ListRest(/MyApplication/Level1/Level2/index.cfm, "/"). Chris Olive DOHRS Website Administrator [EMAIL PROTECTED] -----Original Message----- From: Nick & Loretta Pioch [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 12, 2000 11:55 AM To: [EMAIL PROTECTED] Subject: Where am I? There MUST be a better way! What is the best way to derive your subdirectory path? For instance, the base of my application might be: /MyApplication/index.cfm where "MyApplication" is a mapping in CFAdministrator Then I have some directory structure, such that one path might be: /MyApplication/Level1/Level2/index.cfm I want to know where I am (reconstruct only the subdirectory path)...that is, I want to dynamically be able to generate: /Level1/Level2 Currently, I'm doing this via lots of string manipulation, and it seems much more painful than it ought to be. What I currently have is: <cfset RootMapping ="/MyApplication/"> <cfset UntrimmedCurrentDirectory = GetDirectoryFromPath(#cgi.path_info#)> <cfset TrimStart = Len(UntrimmedCurrentDirectory)> <cfset CurrentDirectory = RemoveChars(UntrimmedCurrentDirectory, TrimStart, "1")> {note...this takes off an extraneous character that GetDirectoyrFromPath puts on} <cfset SESSION.RelativeDirectory = RemoveChars(CurrentDirectory, "1", len(RootMapping))> And SESSION.RelativeDirectory is what I want. Is there a better way? There's GOT to be a better way! And while I'm asking, could someone explain the <BASE> tag? Would this help me? Thanks! -- Loretta Pioch ---------------------------------------------------------------------------- -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. ------------------------------------------------------------------------------ Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Where am I? There MUST be a better way!
Olive, Christopher M Mr USACHPPM Wed, 12 Apr 2000 09:52:52 -0700
- Where am I? There MUST be a better way! Nick & Loretta Pioch
- Olive, Christopher M Mr USACHPPM

