home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / ibm1 / do101j2.arj / CD.SCR < prev    next >
Text File  |  1991-12-10  |  2KB  |  61 lines

  1. .pg wi full clr
  2.     »cy«COMMAND NAME»gray«: »%t« ChangeDir»ye«
  3.  
  4.     /CD {directory} [N]
  5. /cw
  6.     Change directories to »cy«{directory}»#«.
  7.  
  8.     The »%t«ChangeDir»#« command is the equivalent of DOS' »gr«CD»#« command.
  9.     Any variables in »cy«{directory}»#« are expanded before the command
  10.     is executed. »cy«{directory}»#« must be a valid DOS sub-directory
  11.     after the expansion of any variables.
  12.  
  13.     After the execution of the ChangeDir command, »%t«DO»#« branches to
  14.     one of two labels:
  15.  
  16.     »cy«:CDOK»#«     The ChangeDir command was successfully executed.
  17.     »cy«:CDERROR»#«  The ChangeDir command was NOT successfully
  18.               executed. That is »%t«DO»#« was unable to change to the
  19.               indicated directory.
  20.  
  21.     If the "»ye«N»#«" token is included, the command will »+re«NOT»#« branch to the
  22.     labels, but will continue on the next line of the script regardless
  23.     of the outcome.
  24. .pg clr
  25.     In the following examples, press »bo«<enter>»#« to execute each
  26.     displayed line.
  27.  
  28.     We'll change to the »wh«root directory»#« of your disk using
  29.     this command:
  30.  
  31. |/CD \
  32. :CDERROR
  33. .clr
  34.     Well, that didn't work. Do do sent us to the »cy«:CDERROR»#« label!
  35. .pg
  36. /GOTO CD2
  37. :CDOK
  38. .clr
  39.     Now, we'll do a directory command to verify that everything went
  40.     OK. Press »bo«<ESC>»#« when you are finished viewing the directory.
  41.  
  42. .pg
  43. /DIR
  44. .wi 1 5 79 22 clr
  45.     »%t«DO»#« remembers where it started. The keyword »ye«HOME»#« tells »%t«DO»#« to return
  46.     to it's starting directory.
  47.  
  48.     Notice because of the "»cy«N»#«" token, the command will »+re«NOT»#« branch to
  49.     the label since we know that we can find our way home and would
  50.     go to the same place in the script regardless of the outcome of
  51.     the command.
  52.  
  53. |/CD HOME N
  54.     Here's another directory command to make sure that we made it back
  55.     all right.  Press »bo«<ESC>»#« when you are finished viewing the directory.
  56.  
  57. .pg
  58. /dir
  59. :CD2
  60. /ENDEXEC CLEAR
  61.