Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
How to Iterate the next 10 in a while loop

I am trying to iterate a count of every 10 in a while loop. The code below counts 200 10 times and then stops, the reason it stops is that I need to store the first 10 in a spreadsheet, but that is another problem to solve, right now, I am not sure how to go about moving onto the next 10 counts taken from the first 10 count in the while loop below.

while (go) {
    data = getRecordsByPage(i,200,token,module);
    if (Number(data.info.count) < 200) {
      go = false;
    };
    if (i == 10) {
       go = false;
    
       while(go = false)
       {
         Utilities.sleep(10000)
       }
        if(Utilities.sleep == 10000)
        {
          go = true;
        }

    }
     rows = Number(rows) + Number(data.info.count);
    i++;

  Logger.log(rows)
}

Also, please let me know if having a nested while loop in this is loop a good way to restart the loop again with the timer before it restarts.

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

How about using modulo?

replace if (i == 10) { by if (i%10 == 0) {

This way, it will enter in your if statement every multiple of 10

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda