You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Andreas Kuckartz <A....@ping.de> on 2009/09/24 08:39:46 UTC

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

> 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)

Posted by Markus Pallo <pa...@dig.de>.
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 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
>
>   


-- 
------------------------------------------------------------------
DIG Digitale Medienberatungs-
und Produktions- GmbH
Neckarstr. 1/5
78727 Oberndorf a. N.

Amtsgericht Stuttgart HRB 480914
Geschäftsführer: Carsten Huber
------------------------------------------------------------------
Tel: +49 (0)7423 8750 60
Fax: +49 (0)7423 8750 23
Internet: http://www.dig.de
eMail: pallo@dig.de

Ein Unternehmen der Schwarzwälder Bote Mediengruppe