• Post Reply Bookmark Topic Watch Topic
  • New Topic

What's wrong with this while loop?

 
Tris Rabar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
I have some very straightforward code that contains a while loop, but for some reason this while loop is not being entered, although the conditions for it are true.
Can anyone help?
Here's the code:

At the statements before the while loop, message_code = "0000 1001" and hashtable_code = "";
Thanks for your time!
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are sure that msg.hasMoreElements() is returning true?
 
Younes Essouabni
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this line return?
Enumeration msg = SS7.message_catalog.getMessages();
 
Tris Rabar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That condition 'msg.hasMoreElements()' did return false. I did not check that before becasue it was straightforward so I just assumed it did return true. Thanks..! It works fine now, after I corrected this. I have to be more careful!!
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never assume
 
Tris Rabar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hehehe...thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!