Thread: Using the continue statement

Results 1 to 6 of 6
  1. #1 Using the continue statement 
    Registered Member
    Join Date
    Feb 2009
    Posts
    138
    Thanks given
    0
    Thanks received
    17
    Rep Power
    14
    Yeah umm, I know what the statement means and what it does, but what is a good time to use it in RSPS programming;

    Discuss;
    Quote Originally Posted by I astro I View Post
    You're depending on 1 guy who finally has a life outside of the internet to keep this thing 24/7.

    None of the admins. have any control when it comes to putting the server back on or keeping forums up. Only person that could do that is Palidino, and like I said he has a life now so it's whenever he comes home to his cave.
    LOLOL. Paladinos own Moderator making fun of him for "finally" achieving a life.
    Reply With Quote  
     

  2. #2  
    Member Using the continue statement Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    When you don't want to perform the action in the for statement for X element for whatever reason.

    break will exit the loop completely, whereas continue just skips the element and carries on looping.

    Attached imageAttached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2009
    Posts
    138
    Thanks given
    0
    Thanks received
    17
    Rep Power
    14
    Ahh, that SORT of answers my question;

    But I also need to know an example of a good time to use it, cause I've been over thinking this for like 10 minutes and I couldn't think of one method or ANYTHING that I could possibly use the continue statement for.
    Quote Originally Posted by I astro I View Post
    You're depending on 1 guy who finally has a life outside of the internet to keep this thing 24/7.

    None of the admins. have any control when it comes to putting the server back on or keeping forums up. Only person that could do that is Palidino, and like I said he has a life now so it's whenever he comes home to his cave.
    LOLOL. Paladinos own Moderator making fun of him for "finally" achieving a life.
    Reply With Quote  
     

  4. #4  
    Member Using the continue statement Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    Code:
    	private void sendMessageToPlayer(String message) {
    		for(Player p : Server.getPlayerHandler().players) {
    			if(p == null || !p.isActive || p.disconnected) {
    				continue;
    			}
    			p.sendMessage(message);
    		}
    	}
    Quickest thing i could think of lol.

    It's exactly the same as using

    Code:
    	private void sendMessageToPlayer(String message) {
    		for(Player p : Server.getPlayerHandler().players) {
    			if(p != null && p.isActive && !p.disconnected) {
    				p.sendMessage(message);
    			}
    		}
    	}

    Attached imageAttached image
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2009
    Posts
    138
    Thanks given
    0
    Thanks received
    17
    Rep Power
    14
    AHHHHHHHHHHHHHHHHHH yes!


    Bingo luke, thanks;;

    Back to programming now lmao. (:


    EDIT:


    Oh.. Lmao;

    I suppose its not that useful then ehh?
    Quote Originally Posted by I astro I View Post
    You're depending on 1 guy who finally has a life outside of the internet to keep this thing 24/7.

    None of the admins. have any control when it comes to putting the server back on or keeping forums up. Only person that could do that is Palidino, and like I said he has a life now so it's whenever he comes home to his cave.
    LOLOL. Paladinos own Moderator making fun of him for "finally" achieving a life.
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Jan 2008
    Age
    31
    Posts
    1,380
    Thanks given
    76
    Thanks received
    384
    Rep Power
    962
    God damnit luke u stole my glory u fruit lol.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •