Solved

Coldfusion: Leading Space Bug

Posted on 2003-11-08
1
213 Views
Last Modified: 2013-12-16
I swear, this function returns an undetectable leading space.

If I pass the function to a mid, and start at char 2, it starts on char 2 of the non-leading space version.  Yet if I surrond the function like this
 [#func#]

there is space between the first [ and the beginning of the ourput.  No lie.  I swear to god.  I even tired this:
 #mid(f_publish_news_get_filename(11),2,len(f_publish_news_get_filename))#

and it returned it as if there was no leading space.  Here is the function:

<cffunction name="f_publish_news_get_filename" returntype="string">

      <cfargument name=id default="0">

      <cfset var q1 = querynew("")>
      <cfset var str = "">

      <cfif id EQ 0>

            <cfreturn 0>

      <cfelse>

            <cfquery name=q1 datasource=dramanet>
            SELECT id, posted_date FROM news WHERE id = #id#
            </cfquery>

            <cfset str = trim("#q1.posted_date##q1.id#.html")>

            <cfreturn str>

      </cfif>

</cffunction>

0
Comment
Question by:happydog234
1 Comment
 
LVL 12

Accepted Solution

by:
jyokum earned 500 total points
ID: 9710863
which version of CF are you using. I heard this was fixed in ColdFusion MX 6.1.

Here's the link to a similar thread:
http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_20688576.html
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question