Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-18-2008, 11:09 PM
Member
 
Join Date: Oct 2008
Posts: 2
Rep Power: 0
ToplessGrunt is on a distinguished road
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:

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!

Thanks,

Kyle

Last edited by ToplessGrunt; 10-18-2008 at 11:11 PM. Reason: Oops. ^_^
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 10-18-2008, 11:14 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
What is DELAY, are you using that value in a thread within the while loop?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-19-2008, 12:44 AM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SouthWest Missouri, USA
Posts: 2,229
Rep Power: 4
Norm is on a distinguished road
Default
Quote:
//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.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-20-2008, 01:07 AM
Member
 
Join Date: Oct 2008
Posts: 2
Rep Power: 0
ToplessGrunt is on a distinguished road
Default
But I want it to do it only if (DELAY > 0)
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 10-20-2008, 01:49 AM
CJSLMAN's Avatar
Moderator
 
Join Date: Oct 2008
Location: Mexico
Posts: 1,159
Rep Power: 3
CJSLMAN is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 10-20-2008, 05:12 AM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: SouthWest Missouri, USA
Posts: 2,229
Rep Power: 4
Norm is on a distinguished road
Default
Quote:
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.
Quote:
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?
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 10-20-2008, 12:07 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,513
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Seems no sign of explanation here. Lots of confusions here with this.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
For Loop kian_hong2000 New To Java 1 08-07-2008 03:01 PM
IE crashing on windows 2003 64 bit OS while loading applet java 6 DevzAbhi Advanced Java 0 07-29-2008 02:19 PM
How to use While loop Java Tip java.lang 0 04-17-2008 08:44 PM
do...while loop eva New To Java 16 01-31-2008 07:44 AM
while loop michcio New To Java 5 01-27-2008 01:56 AM


All times are GMT +2. The time now is 12:13 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org