Output is important
Some people wonder why there is an output option in the CFCOMPONENT and CFFUNCTION tags. They see no reason to use it, let alone set it to false. I'll give you a perfect reason.
Formatting
I was writing an auto-scheduled RSS feeder for a client and I had to use a function that I wrote a while back from another CFC. It had to do with some really effective SEO formatting for the feed. The problem was that ever time I ran the function to alter a piece of text to make it 'legal', it put in an extra space. I had no clue where it was coming from or why and because it was in an URL, there was a problem. After looking all over and testing each piece of code, I found that the formatting function didn't have an output argument. Putting one in made the formatting work exactly as it should have.
So next time your pulling your hair out over some strange space, remember my words. Look to the output argument first.


There are no comments for this entry.
[Add Comment]