Solved

Coldfusion: Leading Space Bug

Posted on 2003-11-08
1
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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.
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.
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 the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

751 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