Solved

Coldfusion: Leading Space Bug

Posted on 2003-11-08
1
214 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

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

828 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