I fount the FILEEXISTS command in the programmers manual, but it is
intended to use with the templates, not in 'normal' clarion programming.
I'm using CW2.003
Thanks in advance,
Geert Heijnen
gh...@dds.nl
gh...@superconfex.com
FileExists Function(sav:filename) !sav:filename is a string
DosFile FILE,DRIVER('DOS'),NAME(SAV:FILENAME)
record RECORD
END
END
code
Open(DosFile)
If errorcode = 2 ! File not Found
RETURN(0)
ELSE
CLOSE(DosFile)
RETURN(1)
END
HTH
G.M.H.M. Heijnen wrote:
> Can I somehow check if a dos file exist (something like: IF
> EXISTS('C:\MYFILE.DAT') THEN ...
>
> I fount the FILEEXISTS command in the programmers manual, but it is
> intended to use with the templates, not in 'normal' clarion programming.
>
> I'm using CW2.003
>
> Thanks in advance,
> Geert Heijnen
> gh...@dds.nl
> gh...@superconfex.com
--
Jim Katz
CTO iTradeZone,Inc.
http://www.iag.net/~jimkatz/
ICQ 9891427
Using Clarion for Windows
Always looking for the simpler solution.
IF CheckFile('C:\CONFIG.SYS') = 0 THEN ...
CheckFile FUNCTION (DataSet) ! Declare Procedure
Files QUEUE,PRE()
Name STRING(13)
Date LONG
Time LONG
Size LONG
Attribute BYTE
END
LP LONG
NumRec LONG
CODE ! Begin processed code
DIRECTORY(Files, DataSet, ff_:DIRECTORY)
IF RECORDS(Files) = 0
RETURN(False)
ELSE
RETURN(True)
END
G.M.H.M. Heijnen wrote in message <01bd615c$57d1e1a0$095612c3@pcghnn>...