home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Phoenix CD 2.0
/
Phoenix_CD.cdr
/
01e
/
let12.zip
/
DEMO-2.BAT
< prev
next >
Wrap
DOS Batch File
|
1987-09-17
|
1KB
|
30 lines
echo Off
If `%Name%' == `' Demo
cls
echo ╔════════════════════════════════════════════════════════════════╗
echo ┌─╫────────────────────────────────────────────────────────────────╫─┐
echo │ ║ A demonstration of math: A Batch Loop with index ║ │
echo └─╫────────────────────────────────────────────────────────────────╫─┘
echo ╚════════════════════════════════════════════════════════════════╝
echo
echo One possible application for these mathematic operations is
echo to be able to count the number of times to do a portion of a
echo given batch file.
echo
LET Tops=(ask "How high should I count (preferably less than 30)? ")
if `%Tops%' == `' echo I'll assume you want me to loop 10 times.
if `%Tops%' == `' LET Tops=10
set t=0
:CountTop
if %T% == %Tops% goto CountEnd
LET T=(plus T 1)
Echo This is pass %T% in the demonstration of my ability to count.
goto CountTop
:CountEnd
echo That's the end of the counting test.
echo
pause
set Tops=
set t=
DEMO-3