×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Nov 2010
    Posts
    118

    BIG PROBLEM IN J2ME DATA STRUCTURE (I need help)

    I need to find HOW to stop the LOOP if already sees a string which is equal to the data in my xml file then proceed to another token to search..
    my program does search a specific token(string) from the xml..

    here's the code:

    while(counter < token.countTokens()) // loop up to number of parsed words
    {
    temp_token = token.nextToken();
    for(int i = 1; i < el_root.getChildCount(); i += 2) // PROBLEM IS HERE.. I NEED TO STOP THE LOOP IF THE PROGRAM SEES THE SAME VALUE FROM THE XML
    {
    el_word = el_root.getElement(i);
    el_word_content = el_word.getElement(1);
    if(temp_token.equals(el_word_content.getText(0)))
    {
    el_word_content = el_word.getElement(3);
    encrypted_msg += el_word_content.getText(0) + " ";
    }
    else
    {
    encrypted_msg += temp_token + " ";
    }

    }
    counter++;
    }


    can anyone help me out?

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: BIG PROBLEM IN J2ME DATA STRUCTURE (I need help)

    I do not exactly understand what you are asking, but why don't you use while-loop instead of for-loop and stop when you see the value you are looking for, or use break-statement inside the for-loop?

    Hartti

Similar Threads

  1. need help for storing data in widget
    By vimalrajpara in forum Symbian
    Replies: 1
    Last Post: 2011-01-10, 13:47
  2. Queue data structure in Symbian ???
    By indeewari in forum Symbian
    Replies: 5
    Last Post: 2010-08-18, 15:43
  3. Need to hardcode large amount of data using RMS in J2ME
    By divya_v in forum Mobile Java General
    Replies: 4
    Last Post: 2008-11-24, 12:44
  4. need help in data recovery
    By sulabh120881 in forum Symbian
    Replies: 5
    Last Post: 2006-12-06, 11:53
  5. Need help newbie in big trouble
    By tonysmiff in forum Symbian
    Replies: 1
    Last Post: 2004-01-21, 10:18

Posting Permissions

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