on 06-11-2013 4:47 PM
Hi ALL,
I am having some problems while dealing with FOR NEXT LOOP.
I am getting some data from a table throgh a repeater,For each value of the REPEATER which is a mathematical expression i am executing a FOR NEXT loop to evaluate something.
I am checking for spaces through a condition block.As soon as i get the Last space in the expression i am putting BREAK=true otherwise some other operation is to be performed.
Till here it serves the purpose.But the problem is that once it breaks it never again goes into the FOR NEXT loop for other REPEATER values.
What i want is that after it breaks it should again loop for the next REPEATER value as should be the case as far as i think.
I am not getting why it is not getting inside the FOR NEXT loop once it breaks.
Can any one please explain why is it happening and whats the way to serve the purpose consedering that it is neccassary for me to BREAK the loop.
Hello Praveen,
when you set the property BREAK to true on the LoopNext, they will only break the LoopNext. The
main thing here is, that you have to set the BREAK on the LoopNext after leaving the iteration back
to false. A BREAK of the LoopNext will not break the Repeater.
BR
Pedro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
BREAK command in MII works in a different manner if compared with the various programming languages. Long time back I also thought that it would behave in the same manner as it works for the other languages.
When you put a BREAK on certain condition it breaks your NEXT loop as well as your REPEATER loop and hence will not have any further iterations on your REPEATER.
The way out here is to take a local variable and set and reset its values accordingly to meet your requirements.
To elaborate considering your scenario, take a local variable X set to 1 and refer the screenshot
Hope this helps!!
Best Regards,
Anuj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
I am not sure about the behavior of For Next Loop under the Repeater. But, you can indirectly try this to break the For Next Loop Alone.
Assign CurrentItem Property of For Next Loop action with To Property(instead of assigning break to true), on the same condition when you want to break the For Next Loop.
Regards,
Austin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.