[Templates] Recursive function / block problem

Simon Moore simon.moore@fitronics.co.uk
Thu, 09 Oct 2003 12:09:03 +0100


--=======2A0F2A8A=======
Content-Type: text/plain; x-avg-checked=avg-ok-4E3E5E5; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit


I was wondering if recursive functions can be done in TT safely and how 
should they be done?  What I currently have is:

[% BLOCK mySQLFunction %]
         #blah blah
[% END %]

[% BLOCK myfunction %]
                 #blah blah, doing things with obj, returning stuff in 
global variables
         [% PROCESS mySQLFunction tempSQL=tempSQL %]             #call 
another function
         [% PROCESS myfunction obj=nextobj;  %]                  # 
recursive call
[% END %]

[% PROCESS myfunction obj=root;  %]      # first call

I am actually recursively doing stuff with an XML document, with various 
variables outside of the function receiving the results.

The problem is that occasionally when the web page is called instead of it 
working I get "myfunction not found" or something similar (now I want the 
error message the page is working every time).

Should what I am doing work okay or am I doing something dangerous or is 
there a better / safer way of doing this?

Thanks in advance
Simon




---
Simon Moore Llb (Lond) MSc MIEE
Technical Manager
Fitronics Ltd.
Carpenter House
Broad Quay
Bath
BA1 1UB
+44 (0) 1225 388658
simon.moore@fitronics.co.uk 

--=======2A0F2A8A=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-4E3E5E5
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.522 / Virus Database: 320 - Release Date: 29/09/2003

--=======2A0F2A8A=======--