[Xpand] iteration over integer list [message #629152] |
Mon, 27 September 2010 07:23  |
Eclipse User |
|
|
|
Hey,
I have an attribute length in my type element which is of type integer. Now I want to generate the following code, where n is the value of length.
callFunction(0);
callFunction(1);
callFunction(2);
callFunction(3);
callFunction(4);
callFunction(5);
...
callFunction(n);
How can i do that? My suggestion was to use a built-in function that generates a List[int] and to iterate over it with FOREACH. But I only know the following operation which only inserts 0 and n into the list:
«FOREACH {'0', element.length} AS i»
callFunction(«i»);
«ENDFOREACH»
Is there also a mechanism to insert all values between 0 and n into that list? (e.g. like in python the following code "for i in range(0, n):")
Thanks!
|
|
|
|
Powered by
FUDForum. Page generated in 0.04594 seconds