×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    21

    Extract an integer from a TBuf

    I`m having some problems trying to extract a number from a TBuf. The TBuf for example could contain this: abcd12345dbca. I wanted to get the 12345 part of the TBuf and place in a TInt variable: i would like to detect an integer within a TBuf. Is there any function that performs this or do i have to do it by hand? And if so how could i do it?

    Thx.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    Please see SDL help and TLex classes.

    yucca

  3. #3
    Nokia Developer Expert
    Join Date
    Apr 2003
    Location
    Finland
    Posts
    425
    Hi,

    'by hand' method, here is some example...aah those familar isalpha methods are there under TChar object :-)~

    http://discussion.forum.nokia.com/fo...=%2Aisdigit%2A

    Do you miss that sprintf(buf, "%d",&num) method...don't worry, it's there:
    Code:
    8< --- SDK ---
    TBuf16<256> tgt;
    _LIT16(KFormat2,"[%04x]"); //generates: 
    tgt.Format(KFormat2,65); //[0041] 
    8< --- SDK ---


    Br V

Posting Permissions

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