Menu

change while index

Help
demonoman
2013-01-06
2013-01-09
  • demonoman

    demonoman - 2013-01-06

    From examples:

    <while condition="true" index="i" maxloops="9">
    <var-def name="digit${i}">
    <template>{$i}</template>
    </var-def>
    </while>
    </var-def>
    

    we have values ranging from 1 to 9.
    How to change this if i need (for example) values ranging from 100 to 109.

     

    Last edit: demonoman 2013-01-06
  • u-h

    u-h - 2013-01-09

    why don't you use a new variable which eqauls 'i+99' instead of i?

    <while condition="true" index="i" maxloops="9">

    <var-def name="j">
    <template>${i.toInt()+99}</template>
    </var>

    <var-def name="digit${j}">
    <template>${j}</template>
    </var-def>

    </while>

     

Log in to post a comment.