home *** CD-ROM | disk | FTP | other *** search
- .pg wi full clr cy
- COMMAND NAME»gray«: »%t« RemoveDir »ye«
-
- /RD {directory} [N]
- /cw
- The »%t«RemoveDir»#« command is the equivalent of DOS' »gr«RMDIR»#« command.
- Any variables in »cy«{directory}»#« are expanded before the command
- is executed. »cy«{directory}»wh« must be a valid DOS sub-directory
- after the expansion of any variables.»#«
- .pg clr
-
- After the execution of the »%t«RemoveDir»#« command, »%t«DO»#« branches to
- one of two labels:
-
- »ma«:RDOK»#« The »%t«RemoveDir»#« command was successfully executed.
- »ma«:RDERROR»#« The »%t«RemoveDir»#« command was »re«NOT»#« successfully executed.
- That is »%t«DO»#« was unable to create the indicated
- directory.
-
- If the "»ye«N»#«" token is included, the command will »+re«NOT»#« branch to the
- labels, but will continue on the next line of the script regardless
- of the outcome.
-
- .pg clr
- ┌──────────────────────────────────┐
- │ »ye«Test of MD/RD directory creation»#« │
- └──────────────────────────────────┘
-
- This short demo will use the »%t«/MD»#« and »%t«/RD»#« commands to create and
- remove a directory. If any command encounters an error, the
- demo will terminate. Press »bo«<enter>»#« to execute each line after
- it is displayed.
-
- |/md temp
- :mdOK
- |/cd temp
- :CDOK
- |/gd Directory
-
- We are in %directory
- |/cd ..
- :CDOK
- |/gd Directory
-
- We are now in %directory
- |/rd temp
- :RDOK
- Directory removed
- |/cd temp
- :CDOK
- OOPS! there's some problem here. Directory should not be accessable!
- /GOTO End
- :mderror
- /GOSUB DispError "Creating Directory with /MD"
- /GOTO End
- :cderror
- /GOSUB DispError "Changing directory with /CD"
- /GOTO End
- :rderror
- /GOSUB DispError "Removing directory with /RD"
- /GOTO End
- :DispError
- ERROR: %DispError01
- /RETURN
- :END
- /ENDEXEC CLEAR