×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    28

    Simple question on String

    Sorry that i dunno how i can manipulate the content of a string descriptor

    If i have a buffer descriptor like this

    TBuf<20> message;

    how can i assign the value "testing" into this descriptor?
    i tried
    message.Copy("testing");
    but it doesn't seem to work?

    can any give me a hand?

    thanks in advance

  2. #2
    Nokia Developer Expert
    Join Date
    Apr 2003
    Location
    Finland
    Posts
    425
    Enclosed can found a common tip how to solve this kind of problems if you are using visual studio6.0 (and if you don't want to read SDK help)

    - Check that your project is configured to produce browse information: From menu, Project/Settings "C/C++" tab check the "Generate browse" info box and in "Browse Info" tab check the "Build browse info file" box. Now after succeeded compilation studio will generate browse database for you.

    - Place cursor above that 'TBuf' and click F12, OK in window.asking something stupid -> Studio will open a header file where TBuf is defined. In this case the file is e32std.h

    - drag and drop that header file on the fileview tab (on the left side of ide) from 'External depenencies' folder to 'Header Files' folder.

    - Go back to editor window, and type 'message.' and a tip window show all methods what are defined for TBuf. Not so many...

    - From e32std.h header file you noticed that TBuf is derived from TBufBase16, place curson above TBufBase16 and click F12, file e32des16.h is opened. Drag and drop that file just like above.

    - Now type again 'message.' and you find several methods available from e32des16.h. E.g. Append(...). Use that in your problem.

    When you have dragged several files, studio will give a good tips for you while editing ...and later you can not live without that feature. Source browser is also really good tool but that is an other storie.

    Boring drag and drop issues ? Yeah...you can buy a visual studio assistant to do that ugly work :-)

    br V

  3. #3
    Nokia Developer Expert
    Join Date
    Apr 2003
    Location
    Finland
    Posts
    425
    An other issue about strings...

    Don't use in symbian this kind code:
    Foo("Hello world");

    Instead:
    _LIT(KHelloMessage, "hello world");
    Foo(KHelloMessage);
    message.Copy(KHelloMessage);

    I think this solves your problem...


    If wondering why, just open SDk help and read for a while.

    :-) A Tip: unicode...

Posting Permissions

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