'get all the circles with radius smaller than 10 for i=0 to N check radius for one circle if radius>10 go to for loop again to check next circle end if
'pseudocode edit to the pseudocode
'get all the circles with radius smaller than 10
for i=0 to Number of Circles
'check radius for one circle
if circles(i).radius<10
'add the circle to the list
circlesList.add(circles(i))
end if
' go to for loop again to check next circle
Thx for your quick help. But this is not what I need. I properly didn't explain my needs well. You simplified my code and make it more precise. However I am looking for sth like goto statement.
Here is one example in using goto statement:
public class MainClass
Shared Sub Main()
Dim counterVariable As Integer = 0
repeat: ' the label
Console.WriteLine("counterVariable: {0}", counterVariable)
' increment the counter
counterVariable += 1
If counterVariable < 10 Then
GoTo repeat ' the dastardly deed
End If
End Sub
I think you're somewhat confused. Luis's code is correct in the sense that it will only add the circles who's radius is less than the number to the list, which sure seams like your asking about.
Anyway, I don't think that GoTo statements are really supported in GH's situation. In order to use GoTo statements you actually have to label the appropriate line that you're going to, and I'm not sure that that's really supported in a runtime compiled situation.
You may also be interested in the Continue statement, which you can put in a For/Do/While structure and will force the code to go back to the top of that control structure. Ultimately this can pretty much be achieved with If...Then statements, or even Case statements, but it is there if need be.