Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Problem with @EVAL, TCC12

May
572
4
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.
 
On 12/28/2010 10:50, dcantor wrote:

> 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)
>
>
>
>
>
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"
 
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.
I believe I've narrowed it down to the occurrence of the string "0b" or "0B" within the hexadecimal digit string following the "0x".
 
Fixed in build 43. (@EVAL was confused about the "0B" and thought it was a
binary number.)
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.
 
Fixed in build 43. (@EVAL was confused about the "0B" and thought it was a
binary number.)
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.
 

Similar threads

Back
Top