home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 01e / let12.zip / DEMO-2.BAT < prev    next >
DOS Batch File  |  1987-09-17  |  1KB  |  30 lines

  1. echo Off
  2. If `%Name%' == `' Demo
  3. cls
  4. echo   ╔════════════════════════════════════════════════════════════════╗
  5. echo ┌─╫────────────────────────────────────────────────────────────────╫─┐
  6. echo │ ║   A demonstration of math: A Batch Loop with index             ║ │
  7. echo └─╫────────────────────────────────────────────────────────────────╫─┘
  8. echo   ╚════════════════════════════════════════════════════════════════╝
  9. echo  
  10. echo One possible application for these mathematic operations is
  11. echo to be able to count the number of times to do a portion of a
  12. echo given batch file.
  13. echo  
  14. LET Tops=(ask "How high should I count (preferably less than 30)? ")
  15. if `%Tops%' == `' echo I'll assume you want me to loop 10 times.
  16. if `%Tops%' == `' LET Tops=10
  17. set t=0
  18. :CountTop
  19. if %T% == %Tops% goto CountEnd
  20. LET T=(plus T 1)
  21. Echo This is pass %T% in the demonstration of my ability to count.
  22. goto CountTop
  23. :CountEnd
  24. echo That's the end of the counting test.
  25. echo  
  26. pause
  27. set Tops=
  28. set t=
  29. DEMO-3
  30.