I have read that use of 'while(true)' is a big no-no and use of 'while(condition)' or 'do...while(condition)' is recommended(1). Can you tell me how to do that here -
while (true){
get some data;
if(condition based on data above), do something;
else(break);
} //repeat until break reached
I could use 'do...while' (see below) but that repeats the 'if' condition so this doesn't seem to be the best option -
do{
get some data; //must happen first to get info to create condition
if(condition based on data above), do something;
} while(condition based on data above);