OT: iterators/for-each loops (Re: sling.include only follows one path)

2009-09-23 Thread Andreas Kuckartz
> // iterate over brick groups and include them > brickGroups = wall.getBrickGroups(); > for (i = 0; i < brickGroups.size(); i++) { >sling.include(brickGroups.get(i).getPath()); > } It is OT but in such a situation one probably could/should use a for-each loop instead: for (BrickGroup brickG

Re: OT: iterators/for-each loops (Re: sling.include only follows one path)

2009-09-23 Thread Markus Pallo
Andreas Kuckartz wrote: // iterate over brick groups and include them brickGroups = wall.getBrickGroups(); for (i = 0; i < brickGroups.size(); i++) { sling.include(brickGroups.get(i).getPath()); } It is OT but in such a situation one probably could/should use a for-each loop instead:

Re: OT: iterators/for-each loops (Re: sling.include only follows one path)

2009-09-24 Thread Bertrand Delacretaz
Hi, On Thu, Sep 24, 2009 at 7:06 AM, Markus Pallo wrote: > ...I made a test and changed wall/html.esp as seen below. > i before include is "1" and after include its "3". > So "i" of the wall is changed by having also "i" in brickgroup template. > > > > --- > brickGrou

Re: OT: iterators/for-each loops (Re: sling.include only follows one path)

2009-09-25 Thread Christoph Papke
Bertrand Delacretaz schrieb: Hi, On Thu, Sep 24, 2009 at 7:06 AM, Markus Pallo wrote: ...I made a test and changed wall/html.esp as seen below. i before include is "1" and after include its "3". So "i" of the wall is changed by having also "i" in brickgroup template. ---

Not-OT Re: OT: iterators/for-each loops (Re: sling.include only follows one path)

2009-09-23 Thread Andreas Kuckartz
> i before include is "1" and after include its "3". > So "i" of the wall is changed by having also "i" in brickgroup template. > for (i = 0; i < brickGroups.size(); i++) { Where is 'i' declared? (Such problems are one of the reasons for for-each loops) Cheers, Andreas

Re: Not-OT Re: OT: iterators/for-each loops (Re: sling.include only follows one path)

2009-09-24 Thread Markus Pallo
only indirect in the for loop. i am wondering why the included script, which has also i in the for loop, changes the value of the surrounding script. I thought includes uses own scope. Markus Andreas Kuckartz wrote: i before include is "1" and after include its "3". So "i" of the wall is ch