×

Discussion Board

Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    Regular Contributor
    Join Date
    Jun 2009
    Posts
    179

    Re: How to have a string array in Symbian

    Ok thanks for your help.

  2. #17
    Regular Contributor
    Join Date
    Mar 2009
    Posts
    58

    Re: How to have a string array in Symbian

    Quote Originally Posted by kkrish View Post
    Hi,

    You can use HBuf as well but the simple way is:

    TBuf<32> st[3];
    st[1].Copy(_L("Alice"));
    st[2].Copy(_L("Jeneffer"));
    st[3].Copy(_L("Christine"));

    for(TInt i=0; i<3; i++)
    {
    use st[i]...
    }


    hope this will help you. You can use HBuf also.
    It is a bit disappointing that the use of C style arrays should be recommended by a FNC, they should be avoided in general in Symbian, and in particular as has been mentioned there are descriptor specific arrays which should be used in preference.

  3. #18
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: How to have a string array in Symbian

    yep, I agree that the CDesCArray options I suggested in the 3rd post would be better than TBuf arrays.. Anyway, people can do it anyway they want to..

  4. #19
    Registered User
    Join Date
    Feb 2011
    Posts
    338

    Re: How to have a string array in Symbian

    Quote Originally Posted by kkrish View Post
    Hi,

    You can use HBuf as well but the simple way is:

    TBuf<32> st[3];
    st[1].Copy(_L("Alice"));
    st[2].Copy(_L("Jeneffer"));
    st[3].Copy(_L("Christine"));

    for(TInt i=0; i<3; i++)
    {
    use st[i]...
    }


    hope this will help you. You can use HBuf also.
    I tried to use it but it says--"undefined identifier st". why??? another thing shoul i start from st[1] or st[0] ??

  5. #20
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: How to have a string array in Symbian

    I would still suggest on using CDesCArray.

  6. #21
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: How to have a string array in Symbian

    Quote Originally Posted by Md. Kayesh View Post
    I tried to use it but it says--"undefined identifier st". why??? another thing shoul i start from st[1] or st[0] ??
    Check whether you have include necessary header files or not. Should start from st[0]

  7. #22
    Nokia Developer Champion
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: How to have a string array in Symbian

    Also check RArray<TPtrC>.

Similar Threads

  1. How do we send and receive string array via bluetooth in J2ME
    By rahulkrishna in forum Mobile Java General
    Replies: 2
    Last Post: 2009-06-04, 01:50
  2. A question about String Literal in Symbian
    By AllenZhu in forum Symbian
    Replies: 1
    Last Post: 2009-05-26, 10:48
  3. Replies: 2
    Last Post: 2008-02-19, 07:15
  4. Symbian and non Symbian J2ME
    By thongtom in forum Mobile Java General
    Replies: 2
    Last Post: 2005-06-28, 10:52
  5. Replies: 1
    Last Post: 2003-12-19, 19:48

Posting Permissions

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