Solved

Coldfusion: Leading Space Bug

Posted on 2003-11-08
1
212 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now