home *** CD-ROM | disk | FTP | other *** search
/ UnrealScript Game Programming All in One / UnrealScriptGameProgrammingAllInOne.iso / UGPAIOListings / UGPAIOListingsCh05 / MyScripts / test2.bat < prev   
Encoding:
DOS Batch File  |  2006-01-19  |  673 b   |  30 lines

  1.  
  2. @rem test2.bat
  3. @rem #1
  4. @rem This program illustrates working with
  5. @rem variables, arguments, and decisions.
  6.  
  7. @cls
  8. @rem #2
  9. @set %message=You followed test2 with
  10. @echo============================================
  11.  
  12.  
  13. @rem #3
  14. @if "%1"=="" (   @rem conditional statement
  15.     @echo You must enter an argument of
  16.     @echo 1 or 2 after test2.
  17.     @echo No action will be taken.
  18.     @goto ONE    @rem go to the label if no argument
  19. )
  20.  
  21. @rem #4
  22. @echo The argument you typed after test2:  %1.
  23. @if %1 == 1 @echo %message% a 1 (one).
  24. @if %1 == 2 @echo %message% a 2 (two
  25.  
  26.  
  27. @echo============================================
  28.  
  29. :ONE    @rem target of label
  30. pause