Forum Discussion
tristaanogre
15 years agoEsteemed Contributor
The label itself does not break from a loop. Instead, you use the label to indicate that, if a condition is met, to go to a particular line designated by the label.
so, for example, if you have a for loop that you're iterating through a list of items or records and you find a particular record, you can use the Go To Label operation http://smartbear.com/support/viewarticle/17269/ to then go to a particular line of code.
Personally, when I was taught programming, I was told to avoid whenever possible any Go To code. While it's helpful for certain things, I'd prefer that, if a condition is met, I execute another keyword test or another script test instead of going to a line of code in the existing test.
so, for example, if you have a for loop that you're iterating through a list of items or records and you find a particular record, you can use the Go To Label operation http://smartbear.com/support/viewarticle/17269/ to then go to a particular line of code.
Personally, when I was taught programming, I was told to avoid whenever possible any Go To code. While it's helpful for certain things, I'd prefer that, if a condition is met, I execute another keyword test or another script test instead of going to a line of code in the existing test.