Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I remove leading/trailing spaces from variables?

Status
Not open for further replies.

josel

Programmer
Oct 16, 2001
716
0
0
US
Greeting friends!

I use application variables to identify my website's directory tree. When calling pages, instead of hardcoding the path, I use the variables which are intended to point to target directories.

I wrote the whole thing in a test/development box in directory c:\inetput\ In my application.cfm template, I defined application variables
application.root="/deco/"
application.images="images/"
application.products="products/"
application.admin="101dc/admin/"
etc. ...

With that in place, all <a href ...> <cfinclude ...> and other commands use these variables to load targeted page or document. This works great and I thought it was a good idea as it gave me a generic way to place documents any where and not having to revise code (except for application.cfm).

I moved the everything to my web server and placed the application in c:\inetpub\deco. The directory tree within deco is same; the only difference is that deco is not within
None of the commands using application variables to load documents appear to work as images are not loaded, and pages are not found (error 404). I set my application.root to &quot;&quot;, &quot;/&quot;, &quot;deco/&quot;, &quot;/deco/&quot; and it still does not work.

I am suspecting that it needs to be set to &quot;&quot; but it adds a blank character to my patch thus possibly comfusing the browse as it might take that character litterally.

I set mappings, both in server and studio ... but I cannot get the application to work as it does in my test/development machine.

Any thoughts will be appreciated!

Regards;


Jose Lerebours
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
if u want to remove spaces in a variable, u must use the Trim function. There's also LTrim and RTrim to remove blanks from the left or from the right. The Trim function remove all the blanks in the variable.
The syntax is : #Trim(yourVariable)#

maybe that may help u
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top