Thread: Unreachable Statement

Results 1 to 7 of 7
  1. #1 Unreachable Statement 
    Registered Member
    Join Date
    Feb 2013
    Posts
    21
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    I get the error

    client.java:22546: error: unreachable statement
    if(playerCommand.startsWith("claim")){
    ^

    This is the command I'm trying to use

    if(playerCommand.startsWith("claim")){
    client.rspsdata(client, client.playerName);
    }

    please help. been trying to fix this for 5 hours.
    Reply With Quote  
     

  2. #2  
    ¯\_(ツ)_/¯


    Join Date
    Jul 2014
    Posts
    1,803
    Thanks given
    928
    Thanks received
    550
    Rep Power
    299
    there's a "return;" thing before that code, so the error is that the code isn't able to be reached, and is not usable.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2013
    Posts
    21
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Hitten View Post
    there's a "return;" thing before that code, so the error is that the code isn't able to be reached, and is not usable.
    a return; thing? i dont understand. there's no return thing
    Reply With Quote  
     

  4. #4  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    post the code above the command you're trying to add
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2013
    Posts
    21
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Stuart View Post
    post the code above the command you're trying to add
    when i do that i get 100 errors
    Reply With Quote  
     

  6. #6  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by tmwdps View Post
    when i do that i get 100 errors
    post the code here.......
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Feb 2013
    Posts
    21
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Stuart View Post
    post the code here.......
    public void rspsdata(client c, String username){
    try{
    username = username.replaceAll(" ","_");
    String secret = "05edf455cb266ccb3ea3ac2715f87326"; //YOUR SECRET KEY!
    String email = "[email protected]"; //This is the one you use to login into RSPS-PAY
    URL url = new URL("http://rsps-pay.com/includes/listener.php?username="+username+"&secret="+secret +"&email="+email);
    BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
    String results = reader.readLine();
    if(results.toLowerCase().contains("!error:")){

    }else{
    String[] ary = results.split(",");
    for(int i = 0; i < ary.length; i++){
    switch(ary[i]){
    case "0":
    //donation was not found tell the user that!
    break;
    case "FIRSPRODUCTID": //product ids can be found on the webstore page
    //add items for the first product
    break;
    case "SECONDPRODUCTID": //product ids can be found on the webstore page
    //add items for the second product here!
    break;
    }
    }
    }
    }catch(IOException e){}
    }


    thats the code, heres the command

    if(playerCommand.startsWith("claim")){
    client.rspsdata(client, client.playerName);
    }
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [HELP]Unreachable Statement[HELP]
    By Adam™ in forum Help
    Replies: 6
    Last Post: 04-18-2010, 03:51 AM
  2. Unreachable statement?
    By Throat in forum Help
    Replies: 1
    Last Post: 04-11-2010, 02:43 AM
  3. Unreachable statement
    By Anton in forum Help
    Replies: 6
    Last Post: 10-28-2009, 01:06 PM
  4. Unreachable Statement?
    By Fearrichy in forum Help
    Replies: 26
    Last Post: 02-21-2009, 10:26 PM
  5. Unreachable Statements
    By Mdog in forum Application Development
    Replies: 0
    Last Post: 04-18-2008, 02:18 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •