Results 1 to 4 of 4
Thread: Error Compiling "Orphaned Case"
- 05-27-2012, 04:22 PM #1
Member
- Join Date
- May 2012
- Posts
- 4
- Rep Power
- 0
Error Compiling "Orphaned Case"
Heres the cmd:
Next is the code this is bouncing off of:Java 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 { ^
Thanks for the help!Java 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; }
- 05-27-2012, 04:31 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
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,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-27-2012, 04:46 PM #3
Member
- Join Date
- May 2012
- Posts
- 4
- Rep Power
- 0
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.
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
- 05-27-2012, 04:56 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Re: Error Compiling "Orphaned Case"
When people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Compiling probem "cannot find symbol"
By thegluups in forum New To JavaReplies: 27Last Post: 01-18-2010, 08:53 PM -
Runtime error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
By shantimudigonda in forum New To JavaReplies: 1Last Post: 11-20-2009, 07:58 PM -
Simple "if" statement problem....compiling error.
By CYANiDE in forum New To JavaReplies: 4Last Post: 10-14-2009, 09:56 PM -
Compiling/Running Project in Command Line: "Could not find main class" Error
By Yasemin Gokce in forum New To JavaReplies: 1Last Post: 06-30-2009, 02:32 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks