Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316691 - For-loop i variable index not working
Summary: For-loop i variable index not working
Status: CLOSED INVALID
Alias: None
Product: Acceleo
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Windows 7
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-12 18:56 EDT by brandon8863 CLA
Modified: 2011-08-18 04:21 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description brandon8863 CLA 2010-06-12 18:56:30 EDT
From the new and noteworthy page:

Acceleo [for] blocks now declare an implicit “i” variable that can be used to retrieve the iteration count. For example, [for (Sequence{4, 5, 6})][i/], [/for] will generate 1, 2, 3.

the [i/] variable gives an error in the editor and does not work during generation.
Comment 1 brandon8863 CLA 2010-06-12 19:09:28 EDT
Resolution:

Within the same .mtl file there was 2 different templates defined. In the template that was not in the one where I was attempting to use the i index variable was a for loop that had i as the local iterator variable. When I changed that variable to item instead of i the editor and generation started working correctly.

Lessons Learned:
Do not use 'i' as iterator variable name in any for loops.
Comment 2 Laurent Goubet CLA 2011-08-18 04:21:52 EDT
Closing our "resolved" and "verified" bugs.