Top "While-loop" questions

A while loop is a control structure used in many programming languages to continuously execute a set of instructions as long as a particular condition is met.

What's the difference between iterating over a file with foreach or while in Perl?

I have a filehandle FILE in Perl, and I want to iterate over all the lines in the file. Is …

perl file for-loop while-loop
Java: for(;;) vs. while(true)

What is the difference between a standard while(true) loop and for(;;)? Is there any, or will both be mapped …

java for-loop while-loop
Scala Unit type

I use opencsv to parse csv files, and my code is while( (line = reader.readNext()) != null ) { .... } I got a compiler …

scala while-loop
Java, need a while loop to reach eof. i.e.while !eof, keep parsing

I currently have a working parser. It parses a file once(not what I want it to do) and then …

java while-loop eof datainputstream
How do I replace while loops with a functional programming alternative without tail call optimization?

I am experimenting with a more functional style in my JavaScript; therefore, I have replaced for loops with utility functions …

javascript recursion while-loop functional-programming tail-call-optimization
Why is 'continue' statement ignoring the loop counter increment in 'while' loop, but not in 'for' loop?

Why does it tend to get into an infinite loop if I use continue in a while loop, but works …

c loops for-loop while-loop continue
Use Python to find average of some numbers

I am using Python to do a question like keep asking user to enter a number or not. If not,…

python while-loop except
how can Sikuli be used for wait for the button untill it displayed it and then click on it?

i m applying a sikuli skript on a webpage so that it when page loads it waits for the specific …

while-loop wait sikuli time-wait
Whats the difference between do while and while in VB.NET?

What's the difference between Do While where the statement is the first line in the loop block and just the …

vb.net loops while-loop do-while
Assignment Condition in Python While Loop

In C, one can do while( (i=a) != b ) { } but in Python, it appears, one cannot. while (i = sys.stdin.…

python loops while-loop conditional-statements