Fixed Function @timer[] does not work as required

Nov 21, 2021
4
0
Hello,

the following batch file should count up the seconds from 1 to 5. This worked fine with TCC version 13.
Code:
@echo off
*setlocal
*unalias *

cls
echo.
timer /1 on
echo.
do 5
   delay 1
   echo %@timer[1,s]
enddo
echo.
timer /1 off

However, in the current TCC version 28 build 18, some nonsense is output instead. Decisive are the 5 output lines in the middle. They should be 1,000 2,000 3,000 4,000 and 5,000. (German output, therefore comma instead of dot.) But look here:
TCC.jpg

("Stoppuhr 1 an / aus" means "stopwatch 1 on / off", "Verstrichene Zeit" means "elapsed time".)

The same problem arises if you specify m (for minutes) or h (for hours) in the @timer[] function.

Best regards

Thomas

[Win10 Pro, x64, version 21H2]
 
May 20, 2008
11,626
110
Syracuse, NY, USA
It's OK here with v28.

Code:
v:\> ver
TCC 28.02.18 x64
Microsoft Windows 10 Pro for Workstations
10.0.19043.1348 (2009, 21H1)

v:\> type timertest.btm
@echo off
*setlocal
*unalias *

echo.
timer /1 on
echo.
do 5
   delay 1
   echo %@timer[1,s]
enddo
echo.
timer /1 off

v:\> timertest.btm

Timer 1 on: 18:34:35

0.999
2.003
3.007
3.996
4.999

Timer 1 off: 18:34:40  Elapsed: 0:00:05.004
 
Nov 21, 2021
4
0
Hello,

thank you, this works

But actually this should work in every country version at first go, without modifying the country specific delimiters before. (In the TCC version 13 I used before, the delimiters did not have to be changed.)

Best regards

Thomas
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,518
96
Albuquerque, NM
prospero.unm.edu
thank you, this works

But actually this should work in every country version at first go, without modifying the country specific delimiters before. (In the TCC version 13 I used before, the delimiters did not have to be changed.)

Oh, I agree. But noticing that the bug depends on the decimal character setting should help Rex to find it.
 

Similar threads