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

Problem with @EVAL, TCC12

Discussion in 'Support' started by dcantor, Dec 28, 2010.

  1. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Using Windows XP Pro, SP3,

    TCC 11.00.52 :
    >echo %@eval[0x04a0bd]
    303293

    (with or without the leading 0 after the 0x)


    TCC 12.00.42 :
    > echo %@eval[0x4a0bd]
    TCC: Syntax error "0x4a0bd"

    (with or without a leading 0 after the 0x)

    Tested with precision set to 0.10 and also 1.20.
     
  2. Glennbo51

    Glennbo51 Guest

    On 12/28/2010 10:50, dcantor wrote:

    I have found this in 12.00.42 x64 on Win 7 pro

    $ echo %@convert[16,10,4a0bd]
    303293

    $ echo %@eval[0x4a]
    74

    $ echo %@eval[0x4a0]
    1184

    $ echo %@eval[0x4a0b]
    0

    $ echo %@eval[0x4a0B]
    0

    $ echo %@eval[0x4a0Bd]
    TCC: Syntax error "0x4a0Bd"
     
  3. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    I believe I've narrowed it down to the occurrence of the string "0b" or "0B" within the hexadecimal digit string following the "0x".
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,855
    Likes Received:
    83
    Fixed in build 43. (@EVAL was confused about the "0B" and thought it was a
    binary number.)
     
  5. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Thanks for the quick action, Rex. Unfortunately, using Help-->Update told me I already had the latest version, and a new download gave me build 42 again, which still has the error.
     
  6. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,855
    Likes Received:
    83
    Correct, because build 43 hasn't been uploaded yet. I will make an announcement here when it is available.
     
  7. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Ah, sorry. I was lacking sleep and judgment when I wrote that.
     
  8. dcantor

    Joined:
    May 29, 2008
    Messages:
    507
    Likes Received:
    3
    Verified that this is fixed in build 44. Thanks for the fix, Rex.

    Just in case you care, though, the following ILLEGAL syntax is still weird:

    echo %@eval[0b0xf]
    15

    echo %@eval[0b0x0]
    0

    echo %@eval[0b10x0]
    16

    Obviously the '0b' and the '0x' get removed and the remaining string
    gets evaluated as hexadecimal.

    A second '0b', following the '0x' are evaluated as hexadecimal digits.

    echo %@eval[0b0x0b1]
    177

    I think it's a bug because it ought to result in something like
    TCC: Syntax error "0b0xf" or perhaps a "no expression" error,
    but it's illegal syntax so no one should have any expectation of getting a
    valid result from a string beginning with 0b and containing a 0f.
     

Share This Page