How to use loop rules in the form
Step 1 : Create a variable ‘Vrow’ which is used to count the loop. Click on ‘Create variable’ Option under Rule Picker From the left side of the Rule tab.
Step 2 : Enter the Variable Name and click on ‘Save Variable’ button and after saving click on ‘Close’ button.
Step 3 : Initialize variable ‘vRow’ by giving ‘1’ as its value. After each iteration the value of ‘vRow’ will be incremented by one .
Step 4 : Create a sub-rule ‘On_GenerateValue_1’ for defining the loop , as the loop contain a set of action which is executed repeatedly and should be separated from the initialization of ‘vRow’.
Step 5 : Define the loop . A loop contains a condition, set of action to be repeated , increment operation .
Define the set of action to be repeated. For example here ‘GridGetValue(DGTest,vRow,1)’ will give the value in that particular row ,which matches with the value in vRow. This value is summed up and stored into a text control named ‘txtTotalValue’.
Increment the value of variable ‘ vRow’ by one.
To continue the iteration call the loop rule by using RunRule function. For example we use ‘RunRule(On_GenerateValue.On_GenerateValue_1)’ . Here ‘On_GenerateValue ‘ is the main rule name and ‘ On_GenerateValue_1’ is the sub-rule name.
Figure 9 shows the Loop rule.