Questions tagged as 'loop'

2
answers

How does Length and Out of For in Javascript work?

I have a constant question about Length and loop for to measure an array or string. Doubt 1: When we use this code: const numero ="teste"; const medir = numero.length; console.log(medir) It returns the value...
asked by 31.01.2018 / 00:27
2
answers

How to make setTimeout run "infinitely"

I need a function to run every 2 minutes. I found this link a solution for my need: Link The Code below, calls an alert after 5 seconds when the mouse is stopped. Note I put 5 seconds to save time on the test. <script type="te...
asked by 03.07.2015 / 16:26
2
answers

Modular programming in Java, called methods

I needed help putting the smallest and largest method to be "heard" in the main method. The logic of the program is to show the user the highest and lowest value of a vector . CODE: import java.util.Scanner; public class L6ex3 { pu...
asked by 19.11.2015 / 03:58
1
answer

Avoid infinite loop of errors

I would like to know if there is a way to avoid infinite loops of errors in Delphi XE2. These errors are usually critical errors of missing a file (like DLL) or without permission to access something. I use exception handling, but in very spo...
asked by 09.01.2015 / 20:00
1
answer

Try-catch in loop causing error

I have the following code, which tries to click a button after 60 seconds, and if it has not loaded, try again after 60 seconds. while(true) { var timeout = setTimeout(function() { try{ document.querySelector...
asked by 10.12.2018 / 15:03
1
answer

jQuery / Select the item within an array, referring to the position of the loop

Good afternoon friends, I'm having trouble finding a logical solution to solving my problem in a loop (for) Within a table, we have price information in the tag: <p class="preco-plano">R$44</p> and I created a blank tag:...
asked by 03.01.2019 / 19:04
2
answers

Struggle with for loop in Ruby

I am having difficulty dynamically displaying the contents of variables. For example: minha_var_1 = %{Um texto} minha_var_2 = %{Outro texto} minha_var_3 = %{Mais outro texto} But, I tried to display both with:...
asked by 21.11.2014 / 20:17
1
answer

Returns value of an array dynamically

I have an array $teste = [1,2,3,4]; <Input type="text" value ="teste[0]" /> //retorna "1" How can I get all the array values in the inputs?     
asked by 24.09.2018 / 21:33
1
answer

JavaScript looping

I'm learning javascript and now I'm starting to learn how to do looping, and I noticed that it's heavily used var i and when it's for / in var x why use those letters? I can use words in their place and it will work normally. Ca...
asked by 09.08.2018 / 20:25
3
answers

Restart application in Python

How do I restart my program with Python? cpf = input('Digite os nove primeiros dígitos do CPF: ') if len(cpf) != 9: # Aqui deve reniciar a aplicação.     
asked by 03.03.2017 / 04:04