xWastedMindx
Once again, I copied and pasted your code and executed it on my box without any discernable trouble.
How's the rest of the page - line numbers for errors don't necessarily point to the offending line. It may be anywhere before that.
Bastien
Philosophical issues.
I believe that functions are abstract pieces of code that take an input and produce an output. The more abstract a function is, the more useful it seems. Write it once, use it anwhere you need it: for DVD names, video tape names, quotations....
To follow my own thinking here, the function could be even more abstract, having the max length as a passed in value, a more abstract name would also be better.
So, you have your points, it is a specific local function that probably will only be used in the very page.