PreviousNextIndex

OS-COPY statement

Executes an operating system file copy command from within ABL.

Syntax

OS-COPY 
  { source-filename | VALUE ( expression ) } 
  { target-filename | VALUE ( expression ) } 

source-filename
VALUE ( expression )
target-filename
VALUE ( expression )
Example

This procedure opens a dialog box that prompts the user to choose a file to copy. It then prompts for a name for the copy. Finally, the procedure uses the OS-COPY statement to copy the file.

r-os-cop.p
DEFINE VARIABLE sourcefilename AS CHARACTER NO-UNDO. 
DEFINE VARIABLE copyfilename   AS CHARACTER NO-UNDO FORMAT "x(20)"  
  VIEW-AS FILL-IN. 
DEFINE VARIABLE OKpressed      AS LOGICAL   NO-UNDO INITIAL TRUE. 
Main: 
REPEAT: 
  SYSTEM-DIALOG GET-FILE sourcefilename 
    TITLE  "Choose File to Copy" 
    MUST-EXIST 
    USE-FILENAME 
    UPDATE OKpressed. 
  IF OKpressed = FALSE THEN 
    LEAVE Main. 
  UPDATE copyfilename WITH FRAME copyframe. 
  OS-COPY VALUE(sourcefilename) VALUE(copyfilename). 
END. 

Notes
See also

OS-ERROR function


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex