> I wrote this really neat recursive function using the > <cffunction> tag on my development system which is running > CFMX on WindowsXP Pro. When I ported to the operational host > (third party), I discovered that they were running a previous > version of CF (I do not know which) which does not support > the new tag. Does anybody know how to do recursion without > the <cffunction> tag?
If your recursive function is relatively simple, you can probably write it as a CF 5-compliant user-defined function, using CFSCRIPT. CFSCRIPT is a tag in which you can write CF commands using a JavaScript-like language, which uses the same syntax and control flow structures as JavaScript, but uses CFML operators and expressions. You can't use CFML tags within a CFSCRIPT tag, though, and CFSCRIPT doesn't support all the things you can do with CFML tags, such as querying a database. Keep in mind that the host would have to be using CF 5 or higher for this to work. Alternatively, you could write a recursive custom tag. However, this is the least desirable alternative, as custom tags don't provide any built-in ability to return values (you can write that ability into your code, though) and they tend to negatively affect performance. Nevertheless, if you need recursion and you're using a version of CF prior to 5, that's the only way you can do it within CFML. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ______________________________________________________________________ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

