×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    40

    Question To merge strings in buffer

    Can anyone plz explain me how to merge two values and string in a buffer .
    It doesn't work with buff.operator +=("string");

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    142

    Re: To merge strings in buffer

    Try buffer.append(buffer);

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    40

    Re: To merge strings in buffer

    had did it. But it did not work to merge the variables value. by its name.

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: To merge strings in buffer

    Variables value? what kind of variables?

    Also always post your questions in relevant sections(this one belongs to Symbian c++ section).

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,672

    Re: To merge strings in buffer

    It may be Java too (perhaps Qt, perhaps even Flash), let us wait until Eshajari tells which platform he is working with.

    Eshajari: it may be a good idea writing a short example about what you want.
    Like "I have int a=5 and String b="string", and I want them to be merged as "string5"."

  6. #6
    Registered User
    Join Date
    Mar 2012
    Posts
    40

    Re: To merge strings in buffer

    Thank u for reply.
    I have a latitude value and a registration value. Wanna send it to server by merging its value in a single string . but latitude are in different format so cant merge it with the number. Any suggestion to do this possible.

  7. #7
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,988

    Re: To merge strings in buffer

    Quote Originally Posted by wizard_hu_ View Post
    It may be Java too (perhaps Qt, perhaps even Flash), let us wait until Eshajari tells which platform he is working with.
    Well i guessed symbian c++ with what was suggested in #2 & she tried

    Regarding appending the lat/long(assuming they are in TReal) to a TBuf:

    const TInt KMaxFolatLength = 15;
    const TInt KDecimalPos = 5;
    TBuf<20>tempLat;
    TBuf<20> tempLong;
    TRealFormat format( KMaxFolatLength, KDecimalPos );
    format.iType = KRealFormatFixed | KDoNotUseTriads;

    tempLat.Num(iLatitude,format);
    tempLong.Num(iLongitude,format);

    Where iLatitude & iLongitude are lat/long in TReal variables. So now you have lat & long in TBuf's & you can append them with other strings.

  8. #8
    Registered User
    Join Date
    Mar 2012
    Posts
    40

    Re: To merge strings in buffer

    Yes sir I m asking about symbian c++ plateform. and using it by carbide c++.

    Actually wanted it as a TDes formate.

  9. #9
    Registered User
    Join Date
    Dec 2011
    Posts
    142

    Re: To merge strings in buffer

    Try comment #7 as vineet jain has said.
    convert it into TBuf and then append and send to server.

  10. #10
    Registered User
    Join Date
    Mar 2012
    Posts
    40

    Re: To merge strings in buffer

    Thank u Vineet.jain and Jayesh. Now its Working.

Similar Threads

  1. can we merge the CarbideC/C++ and J2ME
    By PM5249 in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2010-11-24, 07:07
  2. Replies: 1
    Last Post: 2009-03-16, 17:19
  3. Merge SIS problem
    By neil.young in forum Symbian
    Replies: 9
    Last Post: 2008-10-11, 12:23

Posting Permissions

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