Error Compiling "Orphaned Case"
Heres the cmd:
Code:
src\server\model\players\PlayerSave.java:271: error: orphaned case
case 20:
^
src\server\model\players\PlayerSave.java:284: error: 'else' without 'if'
}else if (line.equals("[ACCOUNT]")) {
ReadMode = 1;
^
src\server\model\players\PlayerSave.java:299: error: 'else' without 'if'
} else {
^
Next is the code this is bouncing off of:
Code:
case 20:
if (token.equals("stored")) {
p.storeditems[Integer.parseInt(token3[0])] = Integer.parseInt(token3[1]);
}
break;
case 21:
if (token.equals("occupy")) {
p.occupied[Integer.parseInt(token3[0])] = Boolean.parseBoolean(token3[1]);
}
break;
} else {
} else if (line.equals("[ACCOUNT]")) { ReadMode = 1;
} else if (line.equals("[CHARACTER]")) { ReadMode = 2;
} else if (line.equals("[EQUIPMENT]")) { ReadMode = 3;
} else if (line.equals("[LOOK]")) { ReadMode = 4;
} else if (line.equals("[SKILLS]")) { ReadMode = 5;
} else if (line.equals("[ITEMS]")) { ReadMode = 6;
} else if (line.equals("[BANK]")) { ReadMode = 7;
} else if (line.equals("[FRIENDS]")) { ReadMode = 8;
} else if (line.equals("[SHOP]")) { ReadMode = 10;
} else if (line.equals("[IGNORES]")) { ReadMode = 9;
} else if (line.equals("[STORED]")) { ReadMode = 20;
} else if (line.equals("[OCCUPY]")) { ReadMode = 21;
} else if (line.equals("[SHOP]")) { ReadMode = 10;
} else if (line.equals("[EOF]")) { try { characterfile.close(); } catch(IOException ioexception) { } return 1;
}
} else {
} try {
line = characterfile.readLine();
} catch(IOException ioexception1) { EndOfFile = true;
}
try { characterfile.close(); } catch(IOException ioexception) { }
return 13;
}
Thanks for the help!
Re: Error Compiling "Orphaned Case"
The logical structure of your program isn't correct; that case label is not part of a switch() statement although it migh look like it ...
kind regards,
Jos
Re: Error Compiling "Orphaned Case"
What do you suggest I change than? I've fixed all of my other problems but this one is just bugging the heck out of my. Quote:
Re: Error Compiling "Orphaned Case"
The logical structure of your program isn't correct; that case label is not part of a switch() statement although it migh look like it ...
kind regards,
Jos
Re: Error Compiling "Orphaned Case"
Quote:
Originally Posted by
RebellionX
What do you suggest I change than? I've fixed all of my other problems but this one is just bugging the heck out of my.
If you can't see what you've done in your own code anymore, the control flow structure of it is too complicated and too convoluted; again: check all your curly brackets.
kind regards,
Jos