Results 1 to 7 of 7
  1. #1
    ToplessGrunt is offline Member
    Join Date
    Oct 2008
    Posts
    2
    Rep Power
    0

    Default While loop crashing?

    I don't know if any of you has used RSPS's to code.

    Well heres an example of the code that makes me crash:

    Java Code:
    while (X == 0) {
    if (DELAY > 0) {
    //Do this, blah blah
    X = 1;
    }
    }
    if DELAY is bigger then 0,
    Itll make a huge lag then by force makes the server crash.
    Else if it isnt, itll work perfectly.
    If anyone has experience in while loops, please help me! :D

    Thanks,

    Kyle
    Last edited by ToplessGrunt; 10-18-2008 at 10:11 PM. Reason: Oops. ^_^

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,266
    Rep Power
    25

    Default

    //Do this, blah blah
    ...
    f DELAY is bigger then 0,
    Itll make a huge lag then by force makes the server crash.
    Take the blah blah out from inside of the if(DELAY >0) statement.

  4. #4
    ToplessGrunt is offline Member
    Join Date
    Oct 2008
    Posts
    2
    Rep Power
    0

    Default

    But I want it to do it only if (DELAY > 0)

  5. #5
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default What is DELAY?

    • What is DELAY? A constant? A variable? An array?
    • Where's the rest of the code?
    • What does Blah, Blah do?

    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,266
    Rep Power
    25

    Default

    if DELAY is bigger then 0,
    Itll make a huge lag then by force makes the server crash.
    Else if it isnt, itll work perfectly.
    There is a contraction here.
    I want it to do it only if (DELAY > 0)
    What is the "it"? Your sample code shows:
    //Do this, blah blah
    Can you explain?

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

Similar Threads

  1. For Loop
    By kian_hong2000 in forum New To Java
    Replies: 1
    Last Post: 08-07-2008, 02:01 PM
  2. Replies: 0
    Last Post: 07-29-2008, 01:19 PM
  3. How to use While loop
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 07:44 PM
  4. do...while loop
    By eva in forum New To Java
    Replies: 16
    Last Post: 01-31-2008, 06:44 AM
  5. while loop
    By michcio in forum New To Java
    Replies: 5
    Last Post: 01-27-2008, 12:56 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
  •