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.

"while read LINE do" and grep problems

I have two files. file1.txt: Afghans Africans Alaskans ... where file2.txt contains the output from a wget on a …

bash grep while-loop cat
Implementing a while loop in android

I can't understand the implementation of a while loop in android. Whenever I implement a while loop inside the onCreate() …

android loops while-loop implementation logcat
Java InputMismatchException

I have this code and I want to catch the letter exception but it keeps having these errors: Exception in …

java exception-handling while-loop try-catch mismatch
while(list($key, $value) = each($array)) vs. foreach($array as $key => $value)?

Recently I experienced this weird problem: while(list($key, $value) = each($array)) was not listing all array values, where replacing …

php arrays loops foreach while-loop
Create a pause inside a while loop in javascript

I would like to create a pause inside a while loop so that I can create n animations that each …

javascript-events while-loop
php PDO fetchAll() - while not working, foreach works

I would like to know if i'm doing fine OR fetchAll() doesn't work with WHILE. here is an exemple $db=…

php pdo foreach while-loop fetchall
How to write a while loop with the C preprocessor?

I am asking this question from an educational/hacking point of view, (I wouldn't really want to code like this). …

c while-loop c-preprocessor
Shell script while read line loop stops after the first line

I have the following shell script. The purpose is to loop thru each line of the target file (whose path …

bash shell ssh while-loop
Perl - while (<>) file handling

A simple program with while( <> ) handles files given as arguments (./program 1.file 2.file 3.file) and standard input of …

perl while-loop cycle filehandle
Efficient and fast Python While loop while using sleep()

I am attempting to communicate with a device over serial using Pyserial. As commands need to be continually sent, they …

python while-loop pyserial