Welcome!

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

SignUp Now!

Changes to @REPEAT

Aug
2,293
111
As of and prior to TCC 33.00.12, the following worked;
Code:
TCC  32.10.21 x64   Windows 10 [Version 10.0.19045.5011]
Copyright 2023 JP Software Inc.  All Rights Reserved

C:\...\TCMD32>echo %@repeat[#,0]
ECHO is OFF

Now, with TCC 33.00.14, it returns;
Code:
C:\...\TCMD33>echo %@repeat[#,0]
TCC: (Sys) The parameter is incorrect.
 "%@repeat[#,0]"

This has affected my PROMPT that uses @REPEAT;
Code:
prompt `$e[9999E$w$g%@repeat[#,0%localcount]%@repeat[@,0%_shell]`

From tcmdupdate.aiu;
Code:
BugFix1 = 33.0.14 @REPEAT - Fixed RTL problem when entering invalid arguments (count < 0)

Ref: How to? - SETLOCAL Level

Joe
 
Just a curiosity ... I issued echo %@repeat[x,-1000000000000] and, after not too long a wait, got 727,379,968 x's.

Any ideas where 727,379,968 came from?
 
Just a curiosity ... I issued echo %@repeat[x,-1000000000000] and, after not too long a wait, got 727,379,968 x's.

Any ideas where 727,379,968 came from?

Code:
C:\>echo %@eval[-1000000000000 =x]
0xFFFFFF172B5AF000

C:\>echo %@eval[-1000000000000 & 0xffffffff =x]
0x2B5AF000

C:\>echo %@eval[-1000000000000 & 0xffffffff]
727379968

C:\>

The repeat count is a 32-bit integer.
 
I'd expect

Code:
v:\> echo %@repeat[x,0]
ECHO is OFF

That's what I asked for. :-)
 
A 32-bit unsigned integer; negative values are meaningless in this context. So everyone please stop flippin' doing that.
Easier said than done when some values are the results of calculations, which usually take a couple tries. Thus, the not-dying-gracefully bug cost me 30+ minutes. Sad that the fix messed somebody else up but yea stop doing that lol. At least my negative values were column differentials ;) i just was too lazy to absolute-value the value.
 
Back
Top