×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Retrieving corresponding array value?

    Hi,
    I have a query regarding array,my question is:

    I have two static array like:
    public static names={"raj","manoj","ayush","ramesh","dilip","rahul","gita","mansha"};
    public static id={"4","6","7","11","200","43l","43","50"};

    Now i have to take the value of corresponding id as per the name.
    if i print the value rahul then i should get the id-431
    All the array names and id are stored in the record store.and array names are displayed
    in a list so if i click in the name in the list i should get the corresponding id.I am sorry if i have made you confused,
    but please help me with the query it will highly appreciated.

    Thanks.

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Retrieving corresponding array value?

    what you can do is go through the first array, compare it's value with the name you are looking for and if it's the same use the same index in the second array to get his id...

  3. #3
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: Retrieving corresponding array value?

    Quote Originally Posted by Tiger79 View Post
    what you can do is go through the first array, compare it's value with the name you are looking for and if it's the same use the same index in the second array to get his id...
    Hi thanks for replying.
    Can you help me with some examples or doc that i can refer to
    i tried a lot but i was not able to do it.

  4. #4
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: Retrieving corresponding array value?

    I want to get the value of the id as i click the name on the list so please help me how can i retrieve the corresponding id of the array.

    Thanks

  5. #5
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: Retrieving corresponding array value?

    Do the experts know the answer if yes then please reply..

  6. #6
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    127

    Re: Retrieving corresponding array value?

    do the experts dont know the answer

  7. #7
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: Retrieving corresponding array value?

    Putting the multiple posts can not help you until and unless you will not use your brain.The answer has already been given by Tiger, did you even try to implement that?
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  8. #8
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Retrieving corresponding array value?

    I'm sorry but traversing an array is somewhat basic basic programming knowledge, if you have no clue on how to implement that you might want to follow a Java course of read a book... The chances that you will be able to create a whole Java app are pretty slim lacking basic Java (and probably OOP) knowledge...
    I was wondering though if you wanted to know which value has been selected from a List object on a Form object ?
    And if so you can have a look at the List Java Doc which will give you a very concise description of the available methods and what they do...

Similar Threads

  1. Replies: 4
    Last Post: 2010-02-28, 02:33
  2. Flash Lite Optimization - For vs While vs ...
    By Thommasc in forum [Archived] Flash Lite on Nokia Devices
    Replies: 2
    Last Post: 2009-10-03, 11:36
  3. How to declare array in header files
    By somnathbanik in forum Symbian
    Replies: 8
    Last Post: 2009-06-13, 04:12
  4. i am not getting the sprites more than two from array
    By want2win in forum Mobile Java Games
    Replies: 8
    Last Post: 2009-02-13, 07:24
  5. corrupted array in namespace
    By jmpep in forum Symbian
    Replies: 2
    Last Post: 2008-11-02, 20:37

Posting Permissions

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