1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Sscanf()?

Discussion in 'Plugins' started by vefatica, May 31, 2010.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,794
    Likes Received:
    29
    With swscanf() I can take apart a datetime using this format string.

    Code:
    L"%4hu%2hu%2hu%2hu%2hu%2hu"
    Can it be done with Sscanf()? If so, what should the format string be?

    Thanks.
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,732
    Likes Received:
    81
    Yes, and the same.

    Though I've also told you (several times!) that I do *not* recommend using Sscanf() and Ssprintf(), as they have a number of internal variations specifically for TCC. (And I will not modify them for any perceived incompatibility with the RTL functions.)
     
  3. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,794
    Likes Received:
    29
    On Mon, 31 May 2010 22:06:59 -0400, rconn <> wrote:

    |---Quote (Originally by vefatica)---
    |With swscanf() I can take apart a datetime using this format string.
    |
    |
    |Code:
    |---------
    |L"%4hu%2hu%2hu%2hu%2hu%2hu"
    |---------
    |Can it be done with Sscanf()? If so, what should the format string be?
    |
    |Thanks.
    |---End Quote---
    |
    |Yes, and the same.
    |
    |Though I've also told you (several times!) that I do *not* recommend using Sscanf() and Ssprintf(), as they have a number of internal variations specifically for TCC. (And I will not modify them for any perceived incompatibility with the RTL functions.)

    Tests show that "%2h" and "%2u" work and that "%2hu" doesn't. If I'm filling
    WORDs I suppose I should be using "%2h" ... right?

    I am not suggesting you change it. It's just fine as it is. I just use it so
    seldom that I must re-discover its peculiarities.
    --
    - Vince
     

Share This Page