Questions tagged as 'loop'

2
answers

How to simplify code using a loop?

How can I simplify the code below using a loop, I am in doubt because of the names of the labels that are sequential, as I put something variable in FieldName1, NomeCampo2 , ..., NomeCampoX . lblNomeCampo1.Text = dt.Rows[1][0].To...
asked by 30.10.2017 / 12:18
2
answers

Save data inside a vector with loop in Python

Good afternoon guys. I have been learning a lot C and C ++, and the part also python. It confuses me a lot of syntaxes at times, because I often think of C and get confused in python. In the case of the python loop, I would like to store data wi...
asked by 01.07.2017 / 17:52
3
answers

Difference between two codes

Code 1, if variable num is 1 or 2 for example, when conv() is called again and I choose option 3 to exit then it runs print I hope I have been useful (: program does not close, only the next time I choose option 3. In code 2 the...
asked by 13.03.2017 / 18:34
2
answers

Handle all images in a directory without having to access [duplicate]

The script below, is responsible for showing a sequence of images at a certain rate of quantity (num), so it is necessary to define a number of images. Check out: Code <html> <body> <script> var dir = 'imagen...
asked by 21.01.2017 / 15:18
1
answer

Program that reads 3 numbers with repeat structure with scanner class!

How to make an algorithm in Java that reads 3 numbers and gives the mean? I know how to do without using repeat structure, but how to do with repeat structure? Here is my code below, but it does not have the expected result: public clas...
asked by 15.11.2016 / 01:25
1
answer

Error while using while generating barcode

First: I'm using the function below and I'm implementing a chile. Reason: I need to generate several codes, for example: 1 2 3 4 5 .... 98 99 100, follow code: <?php $i = 1; while ($i <= 100) { function geraCodigoBarra($numer...
asked by 19.08.2016 / 01:36
2
answers

Looping for as looping parameter while

Since the list cont would have the values: cont = ['t','f','f','t','f'] You could do something like this: while(for cont in cont == 'f'): pass     
asked by 26.07.2016 / 14:30
2
answers

Insert a point in the penultimate item of the variable

I have a variable with the value "14013" and I'm trying to insert a dot to get the following value "140.13" in my loop. for (var i in teste) { for (var j in (teste2[teste[i]])) { valorFinal[j] = resultado1 + resultado2; //valor...
asked by 18.07.2016 / 01:59
1
answer

Create different random password for each loop record

I have a loop that should enter a random password for each record, and when I finish loop (have created the different password for each record), list the results by viewing the password. <?php ob_start(); session_start(); //conexão com...
asked by 02.04.2015 / 14:07
1
answer

Stop the loop when it finds a result

public Objeto busca(String nome){ for(Objeto id : MinhaLista){ if(id.getNome().equals(nome)){ return null; } else { return id; } } } This is the code, i...
asked by 27.11.2014 / 02:37