Skip to content

DIR_REMOVE

DIR_REMOVE removes a directory.

Syntax

leo-grammar
CC "AdoScript" DIR_REMOVE path:strValue.

#--> RESULT ecode:intValue
CC "AdoScript" DIR_REMOVE path:strValue.

#--> RESULT ecode:intValue

Parameters

  • path (strValue) - the path to the directory to be removed

Returns

  • ecode (intValue) - Contains the error code or 0 in case of success.

Details

Relative paths relate to the current working directory (CWD). The directory can only be removed if it is empty.

The return variable ecode has the value 0 if no errors occurred, a value different than 0 if an error occurred.

See Also

GET_CWD
SET_CWD

Examples

asc
CC "AdoScript" DIR_CREATE path:("c:\\temp\\testdir")
IF (ecode = 0) {
  CC "AdoScript" DIR_REMOVE path:("c:\\temp\\testdir")
  IF (ecode = 0) {
    CC "AdoScript" INFOBOX ("Directory successful removed.")
  }
  ELSE {
    CC "AdoScript" INFOBOX ("Directory could not be removed.")
  }
}
ELSE {
  CC "AdoScript" INFOBOX ("Directory already exists or cannot be created.")
}
CC "AdoScript" DIR_CREATE path:("c:\\temp\\testdir")
IF (ecode = 0) {
  CC "AdoScript" DIR_REMOVE path:("c:\\temp\\testdir")
  IF (ecode = 0) {
    CC "AdoScript" INFOBOX ("Directory successful removed.")
  }
  ELSE {
    CC "AdoScript" INFOBOX ("Directory could not be removed.")
  }
}
ELSE {
  CC "AdoScript" INFOBOX ("Directory already exists or cannot be created.")
}

Crates a new directory and removes it afterwards.

Versions and Changes

Available since ADOxx 1.3