There are something similar to “Exit While” and “Continue While” of vb.net?
Exemple:
> Dim index As Integer = 0
> While index < 100000
> index += 1
>
> If index >= 5 And index <= 8 Then
> Continue While
> End If
>
> If index = 10 Then
> Exit While
> End If
> End While
You can indeed take this approach, but there’s a big if: if anything inside the loop can also throw an exception and you’re catching the Exception type to break from the loop, these other exceptions will be caught, not handled and lost. This makes things very hard to debug if you forget about this and modify the loop later, especially if the loop is complex and invokes other workflows. So, proceed with caution and be sure to document (with a comment or annotation) where you use it for yourself or anyone else working on this workflow.
You could use Rethrow when debugging which is needed when you use Try/Catch to skip over parts when an Error is thrown and you don’t always recognize actual errors.
You can also use specific Exception names to catch the errors or even Throw a custom Exception and use that as your Exception name. It will catch the Exception in order of most specific I believe.
As @sfranzen suggests, [Invoke Code] activity works beautifully only if the whole loop commands are coded inside the [Invoke Code] activity.
However, there must be loads of circumstances to use [For Each Row] activity in order to utilize various activities inside the loop while “Continue For” statement is absolutely necessary.
I think we should definitely have an activity called something like [Continue For] to make this possible.
Thank @akhi_s27 for sharing the skeleton of the try/catch idea.
I think this should only be used as a workaround to mimic the traditional Continue/Next concept until we can see the following from the Activities panel.
(And my Designer panel looks ugly and messy with this… LOL)