×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    5

    Search from array

    Hi , i am new to J2me. I want to make 5 arrays and i want to search them by inputing from the choicebox.
    Please tell me how should i do it?
    If any1 can give sample program that will be so nice. I really need help right now. or pseudo code would be appreciated

    Kumar

  2. #2
    Regular Contributor
    Join Date
    May 2004
    Posts
    147

    Re: Search from array

    What specifically do you need help with? LCDUI or the logic?

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    5

    Re: Search from array

    i need help with the logic,
    also please refer me how to use a GUI which is easy.

  4. #4
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Search from array

    for the GUI part read this article :
    http://today.java.net/pub/a/today/20.../midletUI.html

    For the arrays (and the choicebox) you first will have to know if those are fix-sized or variable ?
    If it's variable you might want to fill the choicebox first and then get the length (number of items of the choicebox) and use that bumber to create the fix-sized arrays...
    Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them.

  5. #5
    Regular Contributor
    Join Date
    May 2004
    Posts
    147

    Re: Search from array

    There are a lot of tutorials on MIDP and LCDUI on the Nokia site and elsewhere on the web.

    Regarding the logic, I'm not sure what part is the problem. Something like this:

    Code:
    search_term = format_input(raw_search_term);
    item_index = find_item(search_term);
    if (item_index == not_found)
      do_not_found();
    else
      do_found(item_index);
    
    int find_item(search_term) {
      loop over each array item {
        if (item matches search_term) {
          return item index;
        }
      }
      return not_found;
    }

Similar Threads

  1. Compilation array in Double Pointer Array.
    By SymbianTH in forum Open C/C++
    Replies: 3
    Last Post: 2009-09-29, 10:23
  2. RMS record search and to place in an array
    By udaykapavarapu in forum Mobile Java General
    Replies: 4
    Last Post: 2009-04-08, 07:23
  3. Difference between array of pointes and pointer to an array
    By Pradeep Chandra in forum Open C/C++
    Replies: 2
    Last Post: 2008-09-15, 13:45
  4. Replies: 5
    Last Post: 2006-02-26, 17:29
  5. Replies: 0
    Last Post: 2003-06-04, 19:11

Posting Permissions

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