Here's how I did that for a file named 'banner.dat':
Code:
DEF VAR v-banner-test AS CHARACTER EXTENT 6 FORMAT "x(76)" NO-UNDO.
INPUT THROUGH DIR banner.dat NO-ECHO.
SET v-banner-test[1].
SET v-banner-test[2].
SET v-banner-test[3].
SET v-banner-test[4].
SET v-banner-test[5].
SET v-banner-test[6].
INPUT CLOSE.
IF v-banner-test[6] MATCHES "*banner*" THEN DO:
/* do stuff here when banner.dat exists */
END.
This works because line 6 of the DIR command output will have either 'FILE NOT FOUND' or it will contain the filename.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.