Questions tagged as 'break'

3
answers

What is the difference between return and break in a switch case?

In some situations you need to practice switch case for optimization and improvement of code. I have an application developed for Android using Java, which in the case is used in both situations. Below I have an example using return...
asked by 05.01.2017 / 17:56
5
answers

Skip Registration within a while

I would like to know how do I skip a record within a while? For example, when type is 2 it jumps while($pessoa = mysqli_fetch_object($query)){ if($pessoa->tipo == 2){break;} //continua a exibição de pessoa } However, when running th...
asked by 16.06.2017 / 19:42
1
answer

How to use the break statement inside two loops in Ruby?

When you execute the "break" command in "if" are you able to exit the internal and external loop? not just one? while (i < maior) do if tam1>tam2 for i2 in 0 .. tam2 do if(palavra1[i]==palavra2[i2]) iguais = pal...
asked by 16.08.2018 / 20:08
1
answer

Python - Problem when doing print within a loop

I have the following code Python , representative of the game Pedra,Papel,Tesoura . import random listChoices = ["rock","paper","scissor"] print("Choose rock, paper or scissor to play or write exit to leave the game") userChoice =...
asked by 14.02.2017 / 04:14
1
answer

Break does not work in foreach

I have a foreach inside another foreach that will rotate by several values of a specific object. But I need to stop both foreach's when it goes into if, but the break command does not work for some reason, it just keeps running both forea...
asked by 16.03.2017 / 15:13
3
answers

"break" does not end execution as it should

   Create a program where the user can type multiple numeric values and sign them into a list. If the number already exists inside, it will not be added. At the end, all the unique values entered will appear in ascending order. And so far so...
asked by 20.12.2018 / 18:42
1
answer

Break and Continue on Switch

What's the difference between using break and continue within switch ?     
asked by 30.07.2018 / 02:22
1
answer

Stop a function already started in JQuery

The problem is as follows. I have a function called showJsonProducts (); I want it to, when I call another function it stops running, example: $('.btn').click(function(){ showJsonProducts.stop(); ou showJsonProducts().break(); Is ther...
asked by 13.01.2018 / 14:41