Skip to main content
RLS
Inspiring
November 7, 2012
Question

CFFunction CFReturn Strings Chopping Results?

  • November 7, 2012
  • 1 reply
  • 970 views

I have a routine that I can run straight up and it will return a list (pipe-delimited) of 1278 results.

I put it in a function in the same program and I get 1278 results.

I put it in a function in its own CFC and I get 279 results.

Anyone ever experienced something like this?  I'm sure I'm screwing up somewhere, but this is quite odd. May have to switch to structure or something to test it in another way.

ColdFusion 8 on Windows server 2003.

RLS

This topic has been closed for replies.

1 reply

Inspiring
November 7, 2012

Run the function inside and outside your cfc at the same time.  Put cfdumps at various spots to identify the point where the results differ,

RLS
RLSAuthor
Inspiring
November 7, 2012

Thanks, Dan. Will do, but it's awful odd. I copied the majority of the function straight across. It's almost as if the CFC version is chopping off the end result willy-nilly.

I'm going to end up with egg on my face on this one, I just know it. Yet... don't see it now.

RLS
RLSAuthor
Inspiring
November 7, 2012

Yep, egg on the face.  Because this routine had to go to an external API to retrieve results and because that API would only return 500 results at a time, I had to loop through it. Part of my loop included calling another internal function to parse an XML. That internal routine and this one shared a variable, the crucial variable returned with cfreturn.  

Oh, well. Let that be a reminder for anyone who stumbles onto this problem/answer on the internet. Declare your local variables!  http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=buildingComponents_29.html, see "Function local variables"

Thanks again for replying, Dan.