Problem with @EVAL, TCC12

May 29, 2008
571
4
Groton, CT
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.
 
G

Glennbo51

Guest
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"
 
May 29, 2008
571
4
Groton, CT
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".
 
May 29, 2008
571
4
Groton, CT
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.
 
May 29, 2008
571
4
Groton, CT
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
Thread starter Title Forum Replies Date
E Problem with @eval[sin(0)] and similar Support 7
Dick Johnson Weird Color Problem Support 8
fishman@panix.com Problem with 27.15 Support 2
M Problem with VSDevCmd.bat in VS 16.7.3 Support 0
R Problem with @INT[ value] in V26 Support 9
M Selecting test "off by one" problem in Take command Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
K_Meinhard Small problem in german IDE 26 Support 3
B Problem with color in nested shells Support 1
Joe Caverly Problem creating and switching to a DESKTOP Support 9
vefatica Another popup problem Support 10
Alpengreis ffind dialog (/W) problem Support 4
Alpengreis [TCMD v25.00.24] Small space problem with the DE translation in Prefs-GUI Support 1
Alpengreis [TCMD v25.00.24] Problem with copy and paste and the # char via mouse in TCC Support 6
A Problem with functions @int @decimal and identifying Powershell as a shell. Support 12
B IF command problem in tcexit.btm Support 9
fishman@panix.com Problem at Startup of TCC Support 3
P Problem with SFTP copies Support 7
P Problem with FTP copies Support 10
Jay Sage Problem with Context Menu Copy+Paste+Run Key Assignment Support 7
R Problem with %_do_loop in nested do loops Support 2
fishman@panix.com New Problem with later Windows 10 Support 10
Peter Murschall A little problem with LEAVE and COMMENT Support 5
M Handling of %~I problem Support 4
WinLanEm FOR problem Support 18
K Problem With SCRPUT /u Support 3
vefatica What's TCMD's problem with ^e[0m? Support 13
Peter Murschall IDE: RTL with non-English resources-problem is back in Build 28 Support 4
rps Regex problem: \xnn not recognized as a hex character Support 0
rps PRIORITY LOW problem Support 1
old coot Regex problem: \xnn not recognized as a hex character Support 12
vefatica Another problem with build 22. Support 3
Alpengreis [23.x] Download-Problem Support 2
S Problem with " Support 3
C Problem navigating forums Support 11
x13 Problem listing repository files using DIR http(s)://... Support 8
Joe Caverly Problem with TEE in v22 Support 2
Alpengreis Problem with thousands delimiter and colors Support 17
M Take Command 18, migrating to another machine, license problem. Support 1
B TCC 21.01.50 Problem with ALIAS /r and SET /r Support 2
rps How to? @search problem Support 2
WinLanEm @SELECT problem Support 6
T Fixed Problem with use of Batch parameters in the IDE Support 1
Oz Solomon Problem with "list" Support 14
S V21.24 theme problem Support 2
Alpengreis Problem if command prompt is not legacy Support 4
Alpengreis TCMD.INI: The "super hidden" problem ... Support 6
G Odd problem - screen brightness Support 4
rps V20 In-process pipes problem Support 8
Alpengreis Again theme problem [v20.0.21]? Support 11

Similar threads