PreviousNextIndex

SYSTEM-DIALOG GET-FILE statement


(Windows only)

Displays a dialog box that allows the user to enter a filename that is assigned to a character variable. The SYSTEM-DIALOG GET-FILE statement provides a dialog box appropriate to the environment in which it runs.

Note: Does not apply to SpeedScript programming.
Syntax

SYSTEM-DIALOG GET-FILE character-field
  [   FILTERS name filespec
      [ , name filespec ] ... 
      [ INITIAL-FILTER filter-num ] 
  ] 
  [ ASK-OVERWRITE ] 
  [ CREATE-TEST-FILE ] 
  [ DEFAULT-EXTENSION extension-string ] 
  [ INITIAL-DIR directory-string ] 
  [ MUST-EXIST ] 
  [ RETURN-TO-START-DIR ] 
  [ SAVE-AS ] 
  [ TITLE title-string ] 
  [ USE-FILENAME ] 
  [ UPDATE logical-variable ] 
  [ IN WINDOW window ] 

character-field
FILTERS name filespec
INITIAL-FILTER filter-num
ASK-OVERWRITE
CREATE-TEST-FILE
DEFAULT-EXTENSION extension-string
INITIAL-DIR directory-string
MUST-EXIST
RETURN-TO-START-DIR
SAVE-AS
TITLE title-string
USE-FILENAME
UPDATE logical-variable
IN WINDOW window
Example

The following example uses the filename dialog box to run procedures. It allows the user to select and run procedure files until they choose the Cancel button.

r-fildlg.p
DEFINE VARIABLE procname  AS CHARACTER NO-UNDO. 
DEFINE VARIABLE OKpressed AS LOGICAL   NO-UNDO INITIAL TRUE. 
Main:  
REPEAT: 
  SYSTEM-DIALOG GET-FILE procname 
    TITLE   "Choose Procedure to Run ..." 
    FILTERS "Source Files (*.p)"   "*.p", 
            "R-code Files (*.r)"   "*.r" 
    MUST-EXIST 
    USE-FILENAME 
    UPDATE OKpressed. 
  IF OKpressed = TRUE THEN 
    RUN VALUE(procname). 
  ELSE LEAVE Main. 
END. 

Notes

OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex