Consultor Eletrônico



Kbase P125681: ABL/4GL: How to get the name of a subdirectory that starts with a given pattern?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/08/2007
Status: Unverified

GOAL:

ABL/4GL: How to get the name of a subdirectory that starts with a given pattern?

GOAL:

ABL/4GL: How to get the name of a subdirectory that starts with a given string?

FACT(s) (Environment):

All Supported Operating Systems
Progress 8.x
Progress 9.x
OpenEdge 10.x
OpenEdge Category: Language (4GL/ABL)

FIX:

The following code lists the names of all subdirectories of the current directory whose names start with a specific pattern or string:
DEFINE VARIABLE cInitialDiretory AS CHARACTER NO-UNDO.
DEFINE VARIABLE cCurrentFile AS CHARACTER NO-UNDO.
DEFINE VARIABLE cPatern AS CHARACTER NO-UNDO.
ASSIGN
cInitialDiretory = "C:\Documents and Settings\yshanshi\My Documents"
cPatern = "My".
INPUT FROM OS-DIR( cInitialDiretory).
REPEAT:
IMPORT cCurrentFile.
IF LENGTH(cCurrentFile) < 3 THEN NEXT.
FILE-INFO:FILE-NAME = cInitialDiretory + "\" + cCurrentFile.
IF FILE-INFO:FILE-TYPE BEGINS "D" AND FILE-INFO:FILE-NAME MATCHES(cPatern + *) > 0 THEN
DISPLAY FILE-INFO:FILE-NAME FORMAT "x(70)".
END.
INPUT CLOSE.