From: Holger K. <ki...@di...> - 2006-03-07 09:48:36
|
Alex Twisleton-Wykeham-Fiennes wrote: >On Mon 6 March 2006 15:55, Holger King wrote: > > >>Hi Group, >> >>is it possible to realize a webmacro recursion within a webmacro >>template like: >> >>#macro counter($counterParam) { >> CounterParam: $counterParam<br/> >> >> #set $digit = $counterParam + 1 >> >> >> #if($digit < 10) >> $digit < 10! >> #counter($digit) >> #end >> #else >> $digit >= 10 >> #end >>} >> >>#counter(1) >> >>I always get an StackOverflowError when calling the above template. If >>the are alternatives using other webmacro directives implementing a >>recursion logic, tell me further details. Thanx in advance. >> >> > > > Hi, is it even possible to access plugged in WebContext-Tools like URLTool within a "templet" directive like >#templet $counter { > #set $digit = $digit + 1 > #if ($digit < 10) { > [$digit < 10] > > $URL.getRequestURL()?counter=$digit > #eval $Self using { "digit": $digit } > } #else { > [$digi >= 10] > } >} >#eval $counter using { "digit": $digit } > >gives me:- > >[1 < 10] [2 < 10] [3 < 10] [4 < 10] [5 < 10] [6 < 10] [7 < 10] [8 < 10] [9 < >10] [10 >= 10] > >Alex > > >------------------------------------------------------- >This SF.Net email is sponsored by xPML, a groundbreaking scripting language >that extends applications into web and mobile media. Attend the live webcast >and join the prime developer group breaking into this new coding territory! >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 >_______________________________________________ >Webmacro-user mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webmacro-user > > > -- Herzliche Grüße, Holger King --------------------------------------------------- DIG Digitale Medienberatungs- und Produktions- GmbH Neckarstrasse 1-5, D-78727 Oberndorf, Germany Phone: +49 7423 8750-0 Fax: +49 7423 8750-23 mailto:ki...@di... http://www.dig.de --------------------------------------------------- |