Renoir,
I would follow the advise you've got and close the files immediately after you're done rather than wait until the end. However, if this is not an option and you want to close any files that are still open you could do something like the following:
lcStatList = ADDBS(SYS(2023))+"StatList.txt"
LIST STATUS TO (lcStatList) NOCONSOLE
CREATE CURSOR StatList (cStatus C(250))
APPEND FROM (lcStatList) FOR "Handle=" $ cStatus TYPE SDF
DELETE FILE (lcStatList)
SELECT VAL(SUBSTR(cStatus, AT("Handle=", cStatus)+7)) AS nHandle FROM StatList
SCAN
FCLOSE(nHandle)
ENDSCAN
This is very clumsy, but probably still better than a CLOSE ALL.
HTH
>Following is a snip of code from an app the guy before me wrote. Dots just mean that there was irrelevant code between the lines. He issues a Close All in order to make sure the ASCII files are closed before continuing the process. This causes problems for me - both in reality and my sense of order. How do I handle closing any files that were opened with FOpen/FCreate do this is not an issue? Thanks!
>
>Regards, Renoir
>
>
>* - not closing all left some ascii files open, causing conflicts
>
>Close ALL
>.
>.
>.
>m.filein2='C:\SFW\DATA\'+m.filein
>.
>.
>.
>m.fileout=SUBSTR(m.filein,1,AT('.',m.filein))+'ERR'
>m.handlein = FOPEN(m.filein2,0)
>m.handleout= FCREATE(m.fileout,0)
>
Daniel