| How Increment Variable in loop [message #643852] |
Wed, 08 December 2010 08:41  |
Manuel Selva Messages: 189 Registered: July 2009 Location: Grenoble, France |
Senior Member |
|
|
Hi all, in my .mtl file (working on EMF model) I have the following loop
[for (param : Param | subCat.params)]
record.readPayload32("What to put here ??");
[/for]
What I want is to replace the "What to put here" by a value starting at 0 and incremented on each loop's iterration by
The Param EClass has an integer length attribute.
How can I acheive this ? I was not able to find any solution until now ...
Thanks in advance for your help,
Manu
http://manuelselva.wordpress.com/
|
|
|
|
| Re: How Increment Variable in loop [message #643873 is a reply to message #643865] |
Wed, 08 December 2010 09:49   |
Manuel Selva Messages: 189 Registered: July 2009 Location: Grenoble, France |
Senior Member |
|
|
Hi Laurent,
Thanks for the answer but this is not exactly what I need. I nee to increment this variable with a field of my model:
the output will look like for example (with 3 parameters of length 2,4,2 respectively)
record.readPayload32(0);
record.readPayload32(2); // 0 + 2
record.readPayload32(6); // 0 + 2 + 4
http://manuelselva.wordpress.com/
|
|
|
|
|
| Re: How Increment Variable in loop [message #643904 is a reply to message #643883] |
Wed, 08 December 2010 11:09  |
Laurent Goubet Messages: 1548 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070908010903090408080404
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Manuel,
subSequence is for Sequences... you have to use "subOrderedSet" on
OrderedSets :p.
Laurent Goubet
Obeo
On 08/12/2010 16:37, Manuel Selva wrote:
> Thanks again but I don't have the subSequence function:
>
> Cannot find operation (subSequence(Integer, Integer)) for the type
> (OrderedSet(Param))
>
> Any ideas about that ?
--------------070908010903090408080404
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------070908010903090408080404--
|
|
|
Powered by
FUDForum. Page generated in 0.01771 seconds