generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Loop not continuing (Java)

Previous Thread :: Next Thread 
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
24 Feb 2015 11:28 PM
while((hash = bob.readLine()) != null){
System.out.println(hash);
checkWords(hash, bert);
}

This goes through the loop correctly once, after calling checkWords, which returns void.

I have no idea why it isn't calling checkWords for each String hash, but it isn't.

So yeah, if you know why this is happening or how to fix it that would be useful.
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
24 Feb 2015 11:43 PM
A response would be nice. I'm sure about half of this forum know java
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
25 Feb 2015 12:35 AM
B.U.M.P.
Report Abuse
BowtieMod is not online. BowtieMod
Joined: 01 Apr 2013
Total Posts: 804
25 Feb 2015 12:37 AM
What's 'bob'
Report Abuse
Seranok is not online. Seranok
Joined: 12 Dec 2009
Total Posts: 11083
25 Feb 2015 12:38 AM
Is System.out.println(hash); getting executed?
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
25 Feb 2015 12:45 AM
So, I'm assuming bob is a BufferedReader?
What's hash and the referenced BufferedReader's content?
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
25 Feb 2015 12:48 AM
Mkay, so the first part would compile correctly assuming that everything is in order there.

Perhaps showing us your checkWords method would help?
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
25 Feb 2015 12:52 AM
I'm gonna try and fill in the blanks. I can't figure out what bert is nor what checkWords does?

public void checkWords(const char* b, const char* b) {
// what does this do?
}

// what is bert?

BufferedReader bob = new BufferedReader('c:/bob.txt');
const char *hash = null;

while((hash = bob.readLine()) != null){
System.out.println(hash);
checkWords(hash, bert);
}
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
25 Feb 2015 03:56 PM
Nevermind, I fixed it.

I forgot to reset the nested string after each loop, thus causing the inner loop to break immediately after starting
Report Abuse
IoIiderp is not online. IoIiderp
Joined: 05 Feb 2012
Total Posts: 8613
25 Feb 2015 04:21 PM
What has this even to with with ROBLOX?
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
25 Feb 2015 11:11 PM
It doesn't, and it doesn't need to.
Report Abuse
TheLuaWeaver is not online. TheLuaWeaver
Joined: 09 Feb 2010
Total Posts: 1504
26 Feb 2015 12:21 AM
"A response would be nice. I'm sure about half of this forum know java"
Half of this forum don't even know Lua well enough to be helping anyone. Or at all.
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
26 Feb 2015 11:32 PM
Half of people that are in the responder and not asker section of this forum*
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image