PreviousNextIndex

OS-DELETE statement

Executes an operating system file or directory delete from within ABL. Can delete one or more files, a directory, or an entire directory branch.

Syntax

OS-DELETE 
  { filename | VALUE ( expression ) } ... 
  [ RECURSIVE ] 

filename
VALUE ( expression )
RECURSIVE
Example

This procedure opens a dialog box that prompts the user to choose a file to delete, then uses the OS-DELETE statement to delete the file:

r-os-del.p
DEFINE VARIABLE filename  AS CHARACTER NO-UNDO. 
DEFINE VARIABLE OKpressed AS LOGICAL   NO-UNDO INITIAL TRUE. 
Main: 
REPEAT: 
  SYSTEM-DIALOG GET-FILE filename 
    TITLE "Choose File to Delete" 
    MUST-EXIST 
    USE-FILENAME 
    UPDATE OKpressed. 
  IF OKpressed = FALSE THEN LEAVE Main. 
  ELSE OS-DELETE VALUE(filename). 
END. 

Notes
See also

OS-ERROR function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex