Kbase P110449: 4GL: How to search for file names that match a specified pattern?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/15/2008 |
|
Status: Verified
GOAL:
4GL: How to search for file names that match a specified pattern?
GOAL:
4GL: How to search for file names given the beginning of the file name and its extension?
GOAL:
4GL: How to locate directories of files whose names match a specified pattern?
FACT(s) (Environment):
Windows
FIX:
The following procedure searches drive C:\ for all files whose name begin with the string "alpha" and whose extension equals to the string "test":
DEFINE VARIABLE cCommandLine AS CHARACTER NO-UNDO.
DEFINE VARIABLE cFileName AS CHARACTER NO-UNDO.
ASSIGN
cCommandLine = "DIR C:\alpha*.test /S/B > result.txt".
OS-COMMAND SILENT VALUE(cCommandLine).
INPUT FROM "result.txt".
REPEAT:
IMPORT UNFORMATTED cFileName.
MESSAGE cFileName
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.