home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 16 / 16.iso / t / t272 / 1.img / TMESDEMO.EXE / TMESDEM3.BAT < prev   
Encoding:
DOS Batch File  |  1993-11-01  |  1.9 KB  |  60 lines

  1. Echo off
  2. CLS
  3. Echo                          This is the Third TMES DEMO
  4. Echo                       TMES Copyright 1993 by Tee Roper
  5. Echo                             All Rights Reserved
  6. Echo.
  7. Echo It will illustrate the use of Variables, Logic, Math, and Clock use.
  8. Echo First we "TMES" SET four variables: A0 A1 A2 A3 to four values.
  9. ECHO TMES A0 10
  10. tmes A0 10
  11. ECHO TMES A1 20
  12. tmes A1 20
  13. ECHO TMES A2 30
  14. tmes A2 30
  15. ECHO TMES A3 40
  16. tmes A3 40
  17. tmes hour /thour
  18. Echo.
  19. Echo TMES XX /tmin
  20. Echo We set XX equal to the minutes past the hour, like 45, 22, etc.
  21. TMES XX /tmin
  22. TMES hour /gt 12 ans
  23. if '%ans%'=='1' goto pm
  24. TMES suffix AM
  25. goto cont
  26. :pm
  27. TMES hour /sub 12
  28. TMES suffix PM
  29. :
  30. :cont
  31. Echo The time NOW is %HOUR%:%XX% %suffix% as determined by your system.
  32. Echo So, the minutes, XX, in this DEMO was found to be %XX%, now!
  33. Echo.
  34. pause
  35. Echo.
  36. Echo TMES SA %XX%
  37. TMES SA %XX%
  38. Echo We are "saving" that variable %XX% for use later as variable SA.
  39. Echo XX=%XX% and also SA=%SA% because we saved it.  (XX will change later.)
  40. Echo.
  41. Echo We calculate the MODULUS of XX MOD 4 (the remainder after dividing)
  42. ECHO TMES XX /mod 4    (the remainder is stored into XX)
  43. tmes xx /mod 4
  44. Echo Now, We check to see which "A"variable is the same as the "/Tmin" variable
  45. Echo TMES A%XX% /eq 20 ANS
  46. TMES A%XX% /eq 20 ANS
  47. Echo Last, we report the findings...up to the minute (when we checked!)
  48. if '%ANS%' == '0' echo ANSWER (False) The A%XX% is not 20, ANS=%ANS%
  49. if '%ANS%' == '1' echo ANSWER (True)  A%XX% is 20, ANS=%ANS%
  50. :: the XX was changed to 0 or 1 in the MOD statement.
  51. :: that's why we saved XX before we calculated the MOD above.
  52. Echo.
  53. Echo I will erase the 9 variables unless you CONTROL-C to stop me now.
  54. pause
  55. Echo TMES /del A0 A1 A2 A3 ANS XX SA HOUR SUFFIX
  56. TMES /del A0 A1 A2 A3 ANS XX SA HOUR SUFFIX
  57. Echo This is a difficult batch file to understand.  Don't worry if you
  58. Echo don't understand it at first.  Keep it for future use.  Enjoy TMES!
  59. ::
  60.