Computing.Net > Forums > Programming > Big digit clock (batch)

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Big digit clock (batch)

Reply to Message Icon

Name: ricardo647
Date: August 22, 2009 at 19:59:25 Pacific
OS: Windows XP Pro SP3
Subcategory: Batch
Comment:

A simple clock in big digits:
(the blinking effect could be avoided if there was an echo replacement that could define screen coordinates. So for each change, the date string could be merely overwritten, avoiding the cls command)

echo off
color 09
setlocal enabledelayedexpansion
set s1=ÛßÛ ÜÛ -ßßÛ ßßÛ Û Û Ûßß Ûßß ßßÛ ÛßÛ ÛßÛ
set s2=Û Û- Û -Ûßß ßßÛ ßßÛ ßßÛ ÛßÛ-- Û ÛßÛ ßßÛ
set s3=ßßß ßßß ßßß ßßß-- ß ßßß ßßß-- ß ßßß ßßß
::-----012345678901234567890123456789012345678
:loop
cls
echo.
for /f "tokens=1" %%u in ('echo %time%') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set tim=%t:~0,2%%t:~3,2%%t:~6,2%
set t1=!tim:~0,1!
set t2=!tim:~1,1!
set t3=!tim:~2,1!
set t4=!tim:~3,1!
set t5=!tim:~4,1!
set t6=!tim:~5,1!
:line1
set /a pos=4*!t1!
set x1=!s1:~%pos%,3!
set /a pos=4*!t2!
set x2=!s1:~%pos%,3!
set /a pos=4*!t3!
set x3=!s1:~%pos%,3!
set /a pos=4*!t4!
set x4=!s1:~%pos%,3!
set /a pos=4*!t5!
set x5=!s1:~%pos%,3!
set /a pos=4*!t6!
set x6=!s1:~%pos%,3!
echo %x1% %x2% Ü %x3% %x4% Ü %x5% %x6%
::line2
set /a pos=4*!t1!
set x1=!s2:~%pos%,3!
set /a pos=4*!t2!
set x2=!s2:~%pos%,3!
set /a pos=4*!t3!
set x3=!s2:~%pos%,3!
set /a pos=4*!t4!
set x4=!s2:~%pos%,3!
set /a pos=4*!t5!
set x5=!s2:~%pos%,3!
set /a pos=4*!t6!
set x6=!s2:~%pos%,3!
echo %x1% %x2% - %x3% %x4% - %x5% %x6%
:line3
set /a pos=4*!t1!
set x1=!s3:~%pos%,3!
set /a pos=4*!t2!
set x2=!s3:~%pos%,3!
set /a pos=4*!t3!
set x3=!s3:~%pos%,3!
set /a pos=4*!t4!
set x4=!s3:~%pos%,3!
set /a pos=4*!t5!
set x5=!s3:~%pos%,3!
set /a pos=4*!t6!
set x6=!s3:~%pos%,3!
echo %x1% %x2% ß %x3% %x4% ß %x5% %x6%
:wait
for /f "tokens=1" %%u in ('echo %time%') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set tim2=%t:~0,2%%t:~3,2%%t:~6,2%
if %tim2%==%tim% goto :wait
goto :loop



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: August 23, 2009 at 16:12:58 Pacific
Reply:

the blinking effect could be avoided if there was an echo replacement that could define screen coordinates.
You'd have to write one in C/C++. The hardest part would be the text parsing, honestly.


0
Reply to Message Icon

Related Posts

See More


Move files to diff folder... Renaming a directory of f...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Big digit clock (batch)

Programming a digital clock www.computing.net/answers/programming/programming-a-digital-clock/18298.html

Batch file for text replacement www.computing.net/answers/programming/batch-file-for-text-replacement/12883.html

Batch file - reporting HDD space www.computing.net/answers/programming/batch-file-reporting-hdd-space/15057.html