The reason why I (lamely, yeah) paraphrase Shakespeare on this post’s title, is because I want to introduce you to conditional breakpoints.
So basically I have added the possibility of interrupting the execution when a certain condition is met. And what is a condition, then? It is simply a block or an statement with a boolean value (it will fail with anything other than those).
Once you set the condition, the link that is inserted by the breakpoint API is triggered only when that condition is met. Sweet, uh?
A very simple example:
Let’s suppose I want to halt when the value of a counter is non zero. We can use the counter from our past experiments:
Now, we set the breakpoint:
We select “halt on condition” from the following menu:
And we write down the condition, when prompted:
Now if we execute the following workspace:
Nothing happens! And that’s cool, because our counter is still zero… Now, if I increment the counter:
And we execute the workspace again, we get our halt:
Quite simple, but imagine that instead of checking out a counter, you inspect the current context… That enables a lot of possibilities, and I have to keep on experimenting in that regard. Also it may be cool to change the menus so to make them simpler to use…
And that’s it for now. As always, stay tuned, there are more interesting things on the way!