Hi George, 
You make recursive functions in CF just as you would in any language.  Well,
of course, CF doesn't yet have user-definable functions, but you can
certainly make recursive Custom Tags.  It may not always be the most
efficient method, but it can be very effective when speed is not a vital
issue.  It always seems alittle like magic to me.

There's really no special trick.  A CustomTag can be called with parameters
(ie ATTRIBUTES).  Inside the tag, the code calls this same tag, hopefully
with a different set of attributes.  There are two things you need to do to
make recursion work:

1) The attributes with which you call the tag need to be changing; and
2) There needs to be some condition where the code DOES NOT make the
recursive call.

Without these two conditions, the recursion goes on infinitely, and never
"pops" up again.  

But I guess you knew all that already.  Sorry for the lecture.
Best of luck,
Lee (Bjork) Borkman
http://bjork.net ColdFusion Tags by Bjork


-----Original Message-----
From: George Dong [mailto:[EMAIL PROTECTED]]

hi there,
if anyone can tell me how make recursion function in CF template?



IMPORTANT NOTICE:
This e-mail and any attachment to it is intended only to be read or used by
the named addressee.  It is confidential and may contain legally privileged
information.  No confidentiality or privilege is waived or lost by any
mistaken transmission to you.  If you receive this e-mail in error, please
immediately delete it from your system and notify the sender.  You must not
disclose, copy or use any part of this e-mail if you are not the intended
recipient.  The RTA is not responsible for any unauthorised alterations to
this e-mail or attachment to it.  

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to