Forums / Developer / HOw to Replace a while loop ?? / Comment44865
ludo thomas
Friday 16 December 2005 12:37:32 am
thx a lot Clemens.this code is right.....
{switch match=$object.class_name} {case match="Spot"} {let node=fetch('content','node', hash('node_id',$main_node_id))} {let nodetest=$node} {*loop as much as the depth of the current item of the tree, otherwise parent could be NULL*} {section loop=$node.depth} {switch match=$nodetest.object.class_name} {case match="Geoposition"} {*if the current class_name=Geoposition*} {/case} {case} {set nodetest=$nodetest.parent} {*the default case, if the current class_name != Geoposition*} {/case} {/switch} {* at this point, $nodetest is filled with the last Geopositionnement in the tree, exactly the same as your code does (correct me if I'm wrong) *}