S
sacha_schembri
Hi im having trouble with this loop it stops at certain places but
never finiishes as it should
try {
BufferedWriter out = new BufferedWriter(new
FileWriter("file.txt",true));
for (int y = 0; y < stuobj1.stdrec.length;y++){
if (stuobj1.stdrec[1+y].equals(field1))
{y++;y++;y++;}
else
{System.out.println(y);
out.write(stuobj1.stdrec[y]);y++;
out.newLine();
out.write(stuobj1.stdrec[y]);y++;
out.newLine();
out.write(stuobj1.stdrec[y]);y++;
out.newLine();
out.write(stuobj1.stdrec[y]);
out.newLine();
out.close();
}}
} catch (IOException eee) { }
never finiishes as it should
try {
BufferedWriter out = new BufferedWriter(new
FileWriter("file.txt",true));
for (int y = 0; y < stuobj1.stdrec.length;y++){
if (stuobj1.stdrec[1+y].equals(field1))
{y++;y++;y++;}
else
{System.out.println(y);
out.write(stuobj1.stdrec[y]);y++;
out.newLine();
out.write(stuobj1.stdrec[y]);y++;
out.newLine();
out.write(stuobj1.stdrec[y]);y++;
out.newLine();
out.write(stuobj1.stdrec[y]);
out.newLine();
out.close();
}}
} catch (IOException eee) { }