Just a quick not as this is not a solution. <cfset mapID = #propinfo.mapFormat(session.map)#>
Doesn't need the hashes in anyway shape or form. <cfset mapID = propinfo.mapFormat(session.map) /> Is the correct way to do it. Regards, Andrew Scott http://www.andyscott.id.au/ > -----Original Message----- > From: Debbie Morris [mailto:[email protected]] > Sent: Tuesday, 21 December 2010 4:09 AM > To: cf-talk > Subject: Leading space added with CF9.0.1 > > > I'm in the process of building a new CF9.0.1 server to replace our existing > 7.0.2 production server. I'm confused about the behavior I'm seeing when > testing one section of the site. > > There is a link that is generated to point to a PDF of a map. On the new > server, the link is incorrectly generated with a space preceding the map > number (11.00). > /dept/assessment/mapping/pdfs/330/Map_330- 11.00.pdf > > Original code to generate the link: > <cfobject component="/e-service/propertytaxes/propinfo" > name="propinfo"> ââ¬Â¦ <a > href="/dept/assessment/mapping/pdfs/#session.district#/Map_#session.di > strict#-#propinfo.mapFormat(session.map)#.pdf" > onclick="window.open(this.href); return false;">Map of Property</a> > > The mapFormat code from propInfo.cfc: > <cffunction name="MapFormat" access="remote" returntype="string"> > <cfargument name="Map" type="string" required="yes"> > <cfif left(Map,1) eq '0'> > <cfset MapFormated = (right(left(Map,2) & "." & Right(Map,2),4))> > <cfelse> > <cfset MapFormated = (left(Map,2) & "." & Right(Map,2))> > </cfif> > <cfreturn MapFormated> > </cffunction> > > > If I output the session.map value prior to the link, it shows "1100", which is > correct. If I check the length of the variable, it says there are 4 > characters. > > If I change the code to apply the MapFormat function to the string prior to > including it in the link, it works fine (no leading space in front of 11.00): > <cfset mapID = #propinfo.mapFormat(session.map)#> > <a > href="/dept/assessment/mapping/pdfs/#session.district#/Map_#session.di > strict#-#mapID#.pdf" onclick="window.open(this.href); return false;">Map > of Property</a> > > I'm sure I'm overlooking something silly, but after looking at this for so > long, > I'm still clueless. Why would the code work correctly on 7.0.2 but not 9.0.1? > The code is exactly the same (FTPââ¬â¢d from production to test server). > The > only thing that should be different (and potentially the problem) would be a > more recent version of the JTOpen driver I have on the new server. > > FWIW, the MapFormat function is used in several other places within this > section of the site, but none of them have this issue. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~~~~| > Order the Adobe Coldfusion Anthology now! > http://www.amazon.com/Adobe-Coldfusion- > Anthology/dp/1430272155/?tag=houseoffusion > Archive: http://www.houseoffusion.com/groups/cf- > talk/message.cfm/messageid:340154 > Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm > Unsubscribe: http://www.houseoffusion.com/groups/cf- > talk/unsubscribe.cfm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340177 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

