I guess you are invoking ays()
inside a while loop. Let the return type of ays()
be boolean
and let it return
either true
or false
. Invoke ays()
from inside the while
loop and based on the value returned by ays()
, you continue
or break
out of the loop.
while (true) {
//Do Something
if (ays()) {
continue();
} else {
break();
}
}